diff --git a/backend/src/endpoint/contest.rs b/backend/src/endpoint/contest.rs index 6e855af9..143546d3 100644 --- a/backend/src/endpoint/contest.rs +++ b/backend/src/endpoint/contest.rs @@ -106,7 +106,7 @@ impl ContestSet for Arc { } list_request::Request::Pager(old) => { reverse = old.reverse; - as NoParentPager>::from_raw(old.session, &self)? + as NoParentPager>::from_raw(old.session, self)? } }; @@ -117,7 +117,7 @@ impl ContestSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListContestResponse { list, next_session })) } @@ -133,7 +133,7 @@ impl ContestSet for Arc { text_search_request::Request::Text(create) => Pager::text_search(create), text_search_request::Request::Pager(old) => { reverse = old.reverse; - as NoParentPager>::from_raw(old.session, &self)? + as NoParentPager>::from_raw(old.session, self)? } }; @@ -144,7 +144,7 @@ impl ContestSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListContestResponse { list, next_session })) } diff --git a/backend/src/endpoint/education.rs b/backend/src/endpoint/education.rs index 2c759a0d..8bfc8c7a 100644 --- a/backend/src/endpoint/education.rs +++ b/backend/src/endpoint/education.rs @@ -236,7 +236,7 @@ impl EducationSet for Arc { reverse = old.reverse; as HasParentPager>::from_raw( old.session, - &self, + self, )? } }; @@ -248,7 +248,7 @@ impl EducationSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListEducationResponse { list, next_session })) } diff --git a/backend/src/endpoint/problem.rs b/backend/src/endpoint/problem.rs index f8bd8966..6ad0dbd7 100644 --- a/backend/src/endpoint/problem.rs +++ b/backend/src/endpoint/problem.rs @@ -114,7 +114,7 @@ impl ProblemSet for Arc { reverse = old.reverse; as HasParentPager>::from_raw( old.session, - &self, + self, )? } }; @@ -126,7 +126,7 @@ impl ProblemSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListProblemResponse { list, next_session })) } @@ -145,7 +145,7 @@ impl ProblemSet for Arc { } text_search_request::Request::Pager(old) => { reverse = old.reverse; - as HasParentPager>::from_raw(old.session, &self)? + as HasParentPager>::from_raw(old.session, self)? } }; @@ -156,7 +156,7 @@ impl ProblemSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListProblemResponse { list, next_session })) } @@ -414,7 +414,7 @@ impl ProblemSet for Arc { reverse = old.reverse; as HasParentPager>::from_raw( old.session, - &self, + self, )? } }; @@ -426,7 +426,7 @@ impl ProblemSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListProblemResponse { list, next_session })) } diff --git a/backend/src/endpoint/submit.rs b/backend/src/endpoint/submit.rs index 5f119b99..ca2c2314 100644 --- a/backend/src/endpoint/submit.rs +++ b/backend/src/endpoint/submit.rs @@ -77,7 +77,7 @@ impl SubmitSet for Arc { reverse = old.reverse; as HasParentPager>::from_raw( old.session, - &self, + self, )? } }; @@ -89,7 +89,7 @@ impl SubmitSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListSubmitResponse { list, next_session })) } @@ -111,7 +111,7 @@ impl SubmitSet for Arc { reverse = old.reverse; as HasParentPager>::from_raw( old.session, - &self, + self, )? } }; @@ -123,7 +123,7 @@ impl SubmitSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListSubmitResponse { list, next_session })) } diff --git a/backend/src/endpoint/testcase.rs b/backend/src/endpoint/testcase.rs index cacd5c0a..4e1acbe6 100644 --- a/backend/src/endpoint/testcase.rs +++ b/backend/src/endpoint/testcase.rs @@ -97,7 +97,7 @@ impl TestcaseSet for Arc { reverse = old.reverse; as HasParentPager>::from_raw( old.session, - &self, + self, )? } }; @@ -109,7 +109,7 @@ impl TestcaseSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListTestcaseResponse { list, next_session })) } @@ -298,7 +298,7 @@ impl TestcaseSet for Arc { reverse = old.reverse; as HasParentPager>::from_raw( old.session, - &self, + self, )? } }; @@ -310,7 +310,7 @@ impl TestcaseSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListTestcaseResponse { list, next_session })) } diff --git a/backend/src/endpoint/user.rs b/backend/src/endpoint/user.rs index 7bd5edb7..e99e8008 100644 --- a/backend/src/endpoint/user.rs +++ b/backend/src/endpoint/user.rs @@ -105,7 +105,7 @@ impl UserSet for Arc { } list_request::Request::Pager(old) => { reverse = old.reverse; - as NoParentPager>::from_raw(old.session, &self)? + as NoParentPager>::from_raw(old.session, self)? } }; @@ -116,7 +116,7 @@ impl UserSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListUserResponse { list, next_session })) } @@ -132,7 +132,7 @@ impl UserSet for Arc { text_search_request::Request::Text(create) => Pager::text_search(create), text_search_request::Request::Pager(old) => { reverse = old.reverse; - as NoParentPager>::from_raw(old.session, &self)? + as NoParentPager>::from_raw(old.session, self)? } }; @@ -143,7 +143,7 @@ impl UserSet for Arc { .map(|x| x.into()) .collect(); - let next_session = pager.into_raw(&self); + let next_session = pager.into_raw(self); Ok(Response::new(ListUserResponse { list, next_session })) } diff --git a/backend/src/endpoint/util/pagination.rs b/backend/src/endpoint/util/pagination.rs index c1298a1c..e0c7d2b8 100644 --- a/backend/src/endpoint/util/pagination.rs +++ b/backend/src/endpoint/util/pagination.rs @@ -136,7 +136,7 @@ where SearchDep::Parent(x) => RawSearchDep::Parent(x), }, }; - let byte = server.crypto.encode(&raw); + let byte = server.crypto.encode(raw); base64::Engine::encode( &base64::engine::general_purpose::STANDARD_NO_PAD, @@ -273,7 +273,7 @@ where SearchDep::Parent(x) => RawSearchDep::Parent(x), }, }; - let byte = server.crypto.encode(&raw); + let byte = server.crypto.encode(raw); base64::Engine::encode( &base64::engine::general_purpose::STANDARD_NO_PAD, diff --git a/backend/src/grpc.rs b/backend/src/grpc.rs index 17e8c2bd..a0c91c71 100644 --- a/backend/src/grpc.rs +++ b/backend/src/grpc.rs @@ -36,7 +36,7 @@ impl Hash for judger::LangInfo { impl PartialOrd for judger::LangInfo { fn partial_cmp(&self, other: &Self) -> Option { - self.lang_uid.partial_cmp(&other.lang_uid) + Some(self.lang_uid.cmp(&other.lang_uid)) } } diff --git a/docker/quickstart/backend.toml b/docker/quickstart/backend.toml index 7b54623b..c87c212b 100644 --- a/docker/quickstart/backend.toml +++ b/docker/quickstart/backend.toml @@ -13,3 +13,7 @@ type = "static" trust_x_forwarded_for = true public_pem = "../cert/cert.pem" private_pem = "../cert/key.pem" + +[imgur] +client_id = "fffffffffffffff" +client_secret = "ffffffffffffffffffffffffffffffffffffffff"