Use drop instead of the toilet closure |_| ()
This commit is contained in:
@@ -23,7 +23,7 @@ impl B {
|
||||
async fn can_error(some_string: &str) -> Result<(), String> {
|
||||
let a = A { inner: vec![some_string, "foo"] };
|
||||
let mut b = B {};
|
||||
Ok(b.something_with_a(a).await.map(|_| ())?)
|
||||
Ok(b.something_with_a(a).await.map(drop)?)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
#![deny(unused_mut)]
|
||||
|
||||
fn main() {
|
||||
vec![42].iter().map(|_| ()).count();
|
||||
vec![42].iter().map(drop).count();
|
||||
vec![(42, 22)].iter().map(|(_x, _y)| ()).count();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ fn assert_invalid_input<T>(on: &str, result: io::Result<T>) {
|
||||
"{} returned a strange {:?} on a path with NUL", on, e.kind()),
|
||||
}
|
||||
}
|
||||
inner(on, result.map(|_| ()))
|
||||
inner(on, result.map(drop))
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
Reference in New Issue
Block a user