From: Gary Guo Date: Tue, 5 May 2026 11:51:37 +0000 (+0100) Subject: rust: pin-init: examples: fix `useless_borrows_in_formatting` clippy warning X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=430654211d566f86e8ee533ff1b01a42be6b602c;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/rust/pin-init/examples/mutex.rs b/rust/pin-init/examples/mutex.rs index 8ed2d3219eb13..35ecb5f68dc31 100644 --- a/rust/pin-init/examples/mutex.rs +++ b/rust/pin-init/examples/mutex.rs @@ -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); } } diff --git a/rust/pin-init/examples/pthread_mutex.rs b/rust/pin-init/examples/pthread_mutex.rs index 4a66316471af7..00f457e688272 100644 --- a/rust/pin-init/examples/pthread_mutex.rs +++ b/rust/pin-init/examples/pthread_mutex.rs @@ -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); } } diff --git a/rust/pin-init/examples/static_init.rs b/rust/pin-init/examples/static_init.rs index 906b96c5d4b95..58cd4241b78ce 100644 --- a/rust/pin-init/examples/static_init.rs +++ b/rust/pin-init/examples/static_init.rs @@ -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); } }