Skip to content

Commit

Permalink
Merge pull request #41 from Zondax/fix/drop
Browse files Browse the repository at this point in the history
Fix dropping reference warning
  • Loading branch information
neithanmo authored Dec 9, 2024
2 parents d840e1a + d901475 commit 6436845
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
rustup show
- name: rustfmt
run: |
cargo fmt --version
# cargo fmt --version
cargo fmt -- --check
- name: clippy
run: |
cargo clippy --version
# cargo clippy --version
cargo clippy --all-targets
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 6436845

Please sign in to comment.