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
This commit is contained in:
Sebastian Dröge 2022-03-24 12:50:47 +02:00
parent c6feb31207
commit 88edc93a8a

View file

@ -123,7 +123,7 @@ impl Harness {
let http_func = http_func.clone(); let http_func = http_func.clone();
Ok::<_, hyper::Error>(service_fn(move |req| { Ok::<_, hyper::Error>(service_fn(move |req| {
let http_func = http_func.clone(); 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)) }
})) }))
} }
}); });