From 72bae18c35d6ee00f92786fc5dcdb583e55a35c7 Mon Sep 17 00:00:00 2001 From: eason <30045503+Eason0729@users.noreply.github.com> Date: Mon, 25 Dec 2023 21:41:37 +0800 Subject: [PATCH] cargo fmt --- backend/src/controller/judger/mod.rs | 2 +- backend/src/controller/judger/route/mod.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/controller/judger/mod.rs b/backend/src/controller/judger/mod.rs index aae281fa..b652a8cc 100644 --- a/backend/src/controller/judger/mod.rs +++ b/backend/src/controller/judger/mod.rs @@ -94,7 +94,7 @@ impl From for Status { match value { Error::JudgerResourceExhausted => Status::resource_exhausted("no available judger"), Error::BadArgument(x) => Status::invalid_argument(format!("bad argument: {}", x)), - Error::LangNotFound=>Status::not_found("languaue not found"), + Error::LangNotFound => Status::not_found("languaue not found"), Error::JudgerError(x) => report_internal!(info, "`{}`", x), Error::Database(x) => report_internal!(warn, "{}", x), Error::TransportLayer(x) => report_internal!(info, "{}", x), diff --git a/backend/src/controller/judger/route/mod.rs b/backend/src/controller/judger/route/mod.rs index 50db737b..fd7cff1f 100644 --- a/backend/src/controller/judger/route/mod.rs +++ b/backend/src/controller/judger/route/mod.rs @@ -82,10 +82,10 @@ impl ConnectionDetail { } /// Deref Guard for Upstream -/// -/// Be aware that you need to call report_success() to use ConnGuard +/// +/// Be aware that you need to call report_success() to use ConnGuard /// without minus healthy score -/// +/// /// The guard is needed because we need to store used connection back to Upstream pub struct ConnGuard { upstream: Arc, @@ -126,8 +126,8 @@ impl Drop for ConnGuard { } /// keep discovering new Upstream from config(IE: docker swarm, static address) -/// -/// occupy future, should generally be spawn in a green thread +/// +/// occupy future, should generally be spawn in a green thread async fn discover( config: JudgerConfig, router: Weak, @@ -174,7 +174,7 @@ async fn discover( } /// Router offer interface for user to manage languages and load balancing -/// +/// /// Basically it's a thick client and also provide ability to list supported languages /// and get judger client correspond to the chosen languages pub struct Router { @@ -215,7 +215,7 @@ impl Router { Ok(self_) } /// get judger client correspond to the chosen languages - /// + /// /// fail if language not found(maybe the judger become unhealthy) pub async fn get(&self, lang: &Uuid) -> Result { let queue = self