diff options
| author | Gary Guo <gary@garyguo.net> | 2026-05-05 12:51:37 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2026-05-10 23:00:51 +0100 |
| commit | 430654211d566f86e8ee533ff1b01a42be6b602c (patch) | |
| tree | f0444e3fc6a43604982fc5ce38cc5939e10194b1 /rust/pin-init/examples | |
| parent | faed81945d0bfcced81a2738d9681a265d41079a (diff) | |
| download | linux-next-430654211d566f86e8ee533ff1b01a42be6b602c.tar.gz linux-next-430654211d566f86e8ee533ff1b01a42be6b602c.zip | |
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>
Diffstat (limited to 'rust/pin-init/examples')
| -rw-r--r-- | rust/pin-init/examples/mutex.rs | 2 | ||||
| -rw-r--r-- | rust/pin-init/examples/pthread_mutex.rs | 2 | ||||
| -rw-r--r-- | rust/pin-init/examples/static_init.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/rust/pin-init/examples/mutex.rs b/rust/pin-init/examples/mutex.rs index 8ed2d3219eb1..35ecb5f68dc3 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 4a66316471af..00f457e68827 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 906b96c5d4b9..58cd4241b78c 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); } } |
