From ada7899b24cacb4f95ee67ae92ddb73c04ee4d66 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 26 Oct 2021 10:20:05 +0200 Subject: Fix clippy lints (fix #121) --- src/web/web_server.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/web/web_server.rs') diff --git a/src/web/web_server.rs b/src/web/web_server.rs index babde62a..bff9e71c 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -36,7 +36,7 @@ pub async fn run_web_server( } }); - let server = Server::bind(&addr).serve(service); + let server = Server::bind(addr).serve(service); let graceful = server.with_graceful_shutdown(shutdown_signal); info!("Web server listening on http://{}", addr); @@ -95,12 +95,12 @@ async fn serve_file(garage: Arc, req: Request) -> Result handle_head(garage, &req, &bucket, &key).await?, + Method::HEAD => handle_head(garage, &req, bucket, &key).await?, Method::GET => handle_get(garage, &req, bucket, &key).await?, _ => return Err(Error::BadRequest("HTTP method not supported".to_string())), }; @@ -173,7 +173,7 @@ fn host_to_bucket<'a>(host: &'a str, root: &str) -> &'a str { /// When a path ends with "/", we append the index name to match traditional web server behavior /// which is also AWS S3 behavior. fn path_to_key<'a>(path: &'a str, index: &str) -> Result, Error> { - let path_utf8 = percent_encoding::percent_decode_str(&path).decode_utf8()?; + let path_utf8 = percent_encoding::percent_decode_str(path).decode_utf8()?; if !path_utf8.starts_with('/') { return Err(Error::BadRequest( -- cgit v1.2.3