Skip to content

Commit 5a4c982

Browse files
committed
Fix dropping reference warning
1 parent d840e1a commit 5a4c982

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

zemu/src/ui_toolkit/backends/nanosplus.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ impl UIBackend<KEY_SIZE> for NanoSPBackend {
141141
}
142142

143143
fn message_buf(&mut self) -> Self::MessageBuf {
144-
core::mem::drop(self);
144+
// core::mem::drop(self);
145+
// We do not know what is self, but the compiler
146+
// does, so let it know we are done with self
147+
// at this point
148+
_ = self;
145149

146150
core::str::from_utf8_mut(&mut Self::static_mut().message)
147151
//this should never happen as we always asciify

zemu/src/ui_toolkit/backends/nanox.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ impl UIBackend<KEY_SIZE> for NanoXBackend {
141141
}
142142

143143
fn message_buf(&mut self) -> Self::MessageBuf {
144-
core::mem::drop(self);
144+
// We do not know what is self, but the compiler
145+
// does, so let it know we are done with self
146+
// at this point
147+
_ = self;
145148

146149
core::str::from_utf8_mut(&mut Self::static_mut().message)
147150
//this should never happen as we always asciify

0 commit comments

Comments
 (0)