Skip to content

Commit eeec389

Browse files
committed
Replace drop($bus) with let $bus = $bus
Clippy doesn't like it when you `drop` a reference
1 parent 93eb20f commit eeec389

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

embedded-hal-async/src/spi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ macro_rules! spi_transaction_helper {
6666
// valid and dereferencable for the entire duration of the closure.
6767
let $bus = unsafe { &mut *$bus };
6868
let result = $closure_body;
69-
::core::mem::drop($bus); // Ensure that the bus reference was not moved out of the closure
69+
let $bus = $bus; // Ensure that the bus reference was not moved out of the closure
70+
let _ = $bus; // Silence the "unused variable" warning from prevous line
7071
result
7172
})
7273
};

0 commit comments

Comments
 (0)