mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 01:08:13 -04:00
rust: pin-init: examples: fix useless_borrows_in_formatting clippy warning
Clippy 1.97 introduces new `useless_borrows_in_formatting` warning which fires on the examples as we have `&*expr` where the format macro takes reference already. Remove the extra borrow. Link: https://patch.msgid.link/20260505115138.2466966-1-gary@kernel.org Signed-off-by: Gary Guo <gary@garyguo.net>
This commit is contained in:
@@ -218,7 +218,7 @@ fn main() {
|
||||
for h in handles {
|
||||
h.join().expect("thread panicked");
|
||||
}
|
||||
println!("{:?}", &*mtx.lock());
|
||||
println!("{:?}", *mtx.lock());
|
||||
assert_eq!(*mtx.lock(), workload * thread_count * 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ fn main() {
|
||||
for h in handles {
|
||||
h.join().expect("thread panicked");
|
||||
}
|
||||
println!("{:?}", &*mtx.lock());
|
||||
println!("{:?}", *mtx.lock());
|
||||
assert_eq!(*mtx.lock(), workload * thread_count * 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ fn main() {
|
||||
for h in handles {
|
||||
h.join().expect("thread panicked");
|
||||
}
|
||||
println!("{:?}, {:?}", &*mtx.lock(), &*COUNT.lock());
|
||||
println!("{:?}, {:?}", *mtx.lock(), *COUNT.lock());
|
||||
assert_eq!(*mtx.lock(), workload * thread_count * 2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user