Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropping reference warning #41

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -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
@@ -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
5 changes: 4 additions & 1 deletion zemu/src/ui_toolkit/backends/nanox.rs
Original file line number Diff line number Diff line change
@@ -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