From 53c9bc8bea46570be6a3235757aba16bd6b34635 Mon Sep 17 00:00:00 2001 From: tieway59 <40034603+TieWay59@users.noreply.github.com> Date: Thu, 5 Oct 2023 08:50:24 +0800 Subject: [PATCH] refactor: remove one clone on `assets_prefix` (#270) This clone is not consist with the usage of `assets_prefix` in following code and it's unnecessary. Signed-off-by: TieWay59 --- src/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index ec2843f..e17e33c 100644 --- a/src/server.rs +++ b/src/server.rs @@ -96,7 +96,7 @@ impl Server { addr: Option, ) -> Result { let uri = req.uri().clone(); - let assets_prefix = self.assets_prefix.clone(); + let assets_prefix = &self.assets_prefix; let enable_cors = self.args.enable_cors; let mut http_log_data = self.args.log_http.data(&req, &self.args); if let Some(addr) = addr { @@ -106,7 +106,7 @@ impl Server { let mut res = match self.clone().handle(req).await { Ok(res) => { http_log_data.insert("status".to_string(), res.status().as_u16().to_string()); - if !uri.path().starts_with(&assets_prefix) { + if !uri.path().starts_with(assets_prefix) { self.args.log_http.log(&http_log_data, None); } res