From 88edc93a8a6d55c840fbd843bcf3efb2f5a8fa88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 24 Mar 2022 12:50:47 +0200 Subject: [PATCH] reqwest: Don't unnecessarily borrow dereferenced values explicitly warning: this expression borrows a value the compiler would automatically borrow --> net/reqwest/tests/reqwesthttpsrc.rs:126:56 | 126 | async move { Ok::<_, hyper::Error>((&mut *http_func.lock().unwrap())(req)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `(*http_func.lock().unwrap())` | = note: `#[warn(clippy::needless_borrow)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow --- net/reqwest/tests/reqwesthttpsrc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/reqwest/tests/reqwesthttpsrc.rs b/net/reqwest/tests/reqwesthttpsrc.rs index 5cde00d5..5dc7ff34 100644 --- a/net/reqwest/tests/reqwesthttpsrc.rs +++ b/net/reqwest/tests/reqwesthttpsrc.rs @@ -123,7 +123,7 @@ impl Harness { let http_func = http_func.clone(); Ok::<_, hyper::Error>(service_fn(move |req| { let http_func = http_func.clone(); - async move { Ok::<_, hyper::Error>((&mut *http_func.lock().unwrap())(req)) } + async move { Ok::<_, hyper::Error>((*http_func.lock().unwrap())(req)) } })) } });