diff options
author | Trinity Pointard <trinity.pointard@gmail.com> | 2021-04-09 02:32:42 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-05-03 22:11:41 +0200 |
commit | f05bb111c2e7dd77f2b34b82892bbfa8e6a063c1 (patch) | |
tree | 0e093982ad6e30a440dcdbd9d8e47c4e75b9d198 /src/rpc/rpc_server.rs | |
parent | 88925ebe2210a8382b4d353fcab15d2b5c345efb (diff) | |
download | garage-f05bb111c2e7dd77f2b34b82892bbfa8e6a063c1.tar.gz garage-f05bb111c2e7dd77f2b34b82892bbfa8e6a063c1.zip |
fix clippy warnings on util and rpc
Diffstat (limited to 'src/rpc/rpc_server.rs')
-rw-r--r-- | src/rpc/rpc_server.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/rpc_server.rs b/src/rpc/rpc_server.rs index 4419a6f0..55d97170 100644 --- a/src/rpc/rpc_server.rs +++ b/src/rpc/rpc_server.rs @@ -57,7 +57,7 @@ where trace!( "Request message: {}", serde_json::to_string(&msg) - .unwrap_or("<json error>".into()) + .unwrap_or_else(|_| "<json error>".into()) .chars() .take(100) .collect::<String>() @@ -123,7 +123,7 @@ impl RpcServer { req: Request<Body>, addr: SocketAddr, ) -> Result<Response<Body>, Error> { - if req.method() != &Method::POST { + if req.method() != Method::POST { let mut bad_request = Response::default(); *bad_request.status_mut() = StatusCode::BAD_REQUEST; return Ok(bad_request); @@ -201,7 +201,7 @@ impl RpcServer { .get_ref() .0 .peer_addr() - .unwrap_or(([0, 0, 0, 0], 0).into()); + .unwrap_or_else(|_| ([0, 0, 0, 0], 0).into()); let self_arc = self_arc.clone(); async move { Ok::<_, Error>(service_fn(move |req: Request<Body>| { |