Skip to content

Commit

Permalink
Explains needless mut borrow
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-goro authored and mbrubeck committed Feb 4, 2022
1 parent ba12cb5 commit 158a3ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,8 @@ fn not_nan_usage_in_const_context() {
fn not_nan_panic_safety() {
let catch_op = |mut num, op: fn(&mut NotNan<_>)| {
let mut num_ref = panic::AssertUnwindSafe(&mut num);
let _ = panic::catch_unwind(move || op(*num_ref));
#[allow(clippy::needless_borrow)] // mut-borrow needed for msrv 1.36.0
let _ = panic::catch_unwind(move || op(&mut *num_ref));
num
};

Expand Down

0 comments on commit 158a3ae

Please sign in to comment.