Skip to content

Commit 6436845

Browse files
authored
Merge pull request #41 from Zondax/fix/drop
Fix dropping reference warning
2 parents d840e1a + d901475 commit 6436845

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
rustup show
3535
- name: rustfmt
3636
run: |
37-
cargo fmt --version
37+
# cargo fmt --version
3838
cargo fmt -- --check
3939
- name: clippy
4040
run: |
41-
cargo clippy --version
41+
# cargo clippy --version
4242
cargo clippy --all-targets

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)