Skip to content

Commit e79eea1

Browse files
committed
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. Signed-off-by: Gary Guo <gary@garyguo.net>
1 parent 499e482 commit e79eea1

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn main() {
218218
for h in handles {
219219
h.join().expect("thread panicked");
220220
}
221-
println!("{:?}", &*mtx.lock());
221+
println!("{:?}", *mtx.lock());
222222
assert_eq!(*mtx.lock(), workload * thread_count * 2);
223223
}
224224
}

examples/pthread_mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ fn main() {
177177
for h in handles {
178178
h.join().expect("thread panicked");
179179
}
180-
println!("{:?}", &*mtx.lock());
180+
println!("{:?}", *mtx.lock());
181181
assert_eq!(*mtx.lock(), workload * thread_count * 2);
182182
}
183183
}

examples/static_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fn main() {
117117
for h in handles {
118118
h.join().expect("thread panicked");
119119
}
120-
println!("{:?}, {:?}", &*mtx.lock(), &*COUNT.lock());
120+
println!("{:?}, {:?}", *mtx.lock(), *COUNT.lock());
121121
assert_eq!(*mtx.lock(), workload * thread_count * 2);
122122
}
123123
}

0 commit comments

Comments
 (0)