Skip to content

Commit

Permalink
Fix dropping reference warning
Browse files Browse the repository at this point in the history
  • Loading branch information
neithanmo committed Dec 9, 2024
1 parent d840e1a commit 5a4c982
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion zemu/src/ui_toolkit/backends/nanosplus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ impl UIBackend<KEY_SIZE> for NanoSPBackend {
}

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

core::str::from_utf8_mut(&mut Self::static_mut().message)
//this should never happen as we always asciify
Expand Down
5 changes: 4 additions & 1 deletion zemu/src/ui_toolkit/backends/nanox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ impl UIBackend<KEY_SIZE> for NanoXBackend {
}

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

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

0 comments on commit 5a4c982

Please sign in to comment.