mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-19 21:08:07 +00:00
chore(core): fix rust warnings and clippy errors
[no changelog]
This commit is contained in:
parent
82cd9ca34e
commit
1c0da78536
@ -2,6 +2,7 @@
|
||||
#![deny(clippy::all)]
|
||||
#![allow(clippy::new_without_default)]
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![allow(internal_features)]
|
||||
// Allowing dead code not to cause a lot of warnings when building for a specific target
|
||||
// (when building for TR, a lot of code only used in TT would get marked as unused).
|
||||
#![allow(dead_code)]
|
||||
|
@ -8,8 +8,7 @@ pub use ffi::{DISPLAY_RESX, DISPLAY_RESY};
|
||||
|
||||
#[cfg(feature = "framebuffer")]
|
||||
pub use ffi::{
|
||||
DISPLAY_FRAMEBUFFER_HEIGHT, DISPLAY_FRAMEBUFFER_OFFSET_X, DISPLAY_FRAMEBUFFER_OFFSET_Y,
|
||||
DISPLAY_FRAMEBUFFER_WIDTH,
|
||||
DISPLAY_FRAMEBUFFER_OFFSET_X, DISPLAY_FRAMEBUFFER_OFFSET_Y, DISPLAY_FRAMEBUFFER_WIDTH,
|
||||
};
|
||||
|
||||
#[cfg(all(feature = "framebuffer", not(feature = "framebuffer32bit")))]
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use super::ffi;
|
||||
|
||||
pub use ffi::{secbool, secfalse, sectrue};
|
||||
|
@ -235,7 +235,7 @@ where
|
||||
self.marked_for_clear = true;
|
||||
let mut dummy_ctx = EventCtx::new();
|
||||
let paint_msg = self.inner.event(&mut dummy_ctx, Event::RequestPaint);
|
||||
assert!(matches!(paint_msg, None));
|
||||
assert!(paint_msg.is_none());
|
||||
assert!(dummy_ctx.timers.is_empty());
|
||||
}
|
||||
msg
|
||||
|
@ -11,7 +11,6 @@ use crate::{
|
||||
geometry::{Alignment2D, Offset, Point, Rect},
|
||||
},
|
||||
};
|
||||
use core::cmp::max;
|
||||
|
||||
#[cfg(feature = "dma2d")]
|
||||
use crate::{
|
||||
@ -27,6 +26,8 @@ use crate::ui::display::{get_color_table, pixeldata};
|
||||
|
||||
#[cfg(feature = "framebuffer")]
|
||||
use crate::trezorhal::{buffers::BufferLine4bpp, dma2d::dma2d_setup_4bpp};
|
||||
#[cfg(feature = "framebuffer")]
|
||||
use core::cmp::max;
|
||||
|
||||
use super::Color;
|
||||
|
||||
|
@ -132,7 +132,7 @@ extern "C" fn screen_install_confirm(
|
||||
|
||||
let mut fingerprint_buffer: [u8; 64] = [0; 64];
|
||||
let fingerprint_str = unsafe {
|
||||
let fingerprint_slice = core::slice::from_raw_parts(fingerprint as *const u8, 32);
|
||||
let fingerprint_slice = core::slice::from_raw_parts(fingerprint, 32);
|
||||
hexlify(fingerprint_slice, &mut fingerprint_buffer);
|
||||
core::str::from_utf8_unchecked(fingerprint_buffer.as_ref())
|
||||
};
|
||||
|
@ -47,8 +47,8 @@ use super::{
|
||||
AddressDetails, ButtonActions, ButtonDetails, ButtonLayout, ButtonPage, CancelConfirmMsg,
|
||||
CancelInfoConfirmMsg, CoinJoinProgress, ConfirmHomescreen, Flow, FlowPages, Frame,
|
||||
Homescreen, Lockscreen, NumberInput, Page, PassphraseEntry, PinEntry, Progress,
|
||||
ScrollableContent, ScrollableFrame, ShareWords, ShowMore, SimpleChoice, WelcomeScreen,
|
||||
WordlistEntry, WordlistType,
|
||||
ScrollableContent, ScrollableFrame, ShareWords, ShowMore, SimpleChoice, WordlistEntry,
|
||||
WordlistType,
|
||||
},
|
||||
constant, theme,
|
||||
};
|
||||
|
@ -142,7 +142,7 @@ extern "C" fn screen_install_confirm(
|
||||
|
||||
let mut fingerprint_buffer: [u8; 64] = [0; 64];
|
||||
let fingerprint_str = unsafe {
|
||||
let fingerprint_slice = core::slice::from_raw_parts(fingerprint as *const u8, 32);
|
||||
let fingerprint_slice = core::slice::from_raw_parts(fingerprint, 32);
|
||||
hexlify(fingerprint_slice, &mut fingerprint_buffer);
|
||||
core::str::from_utf8_unchecked(fingerprint_buffer.as_ref())
|
||||
};
|
||||
|
@ -541,7 +541,7 @@ pub fn homescreen_blurred(data: &mut dyn HomescreenDecompressor, texts: &[Homesc
|
||||
|
||||
let mut next_text_idx = 1;
|
||||
let mut text_info =
|
||||
homescreen_position_text(unwrap!(texts.get(0)), &mut text_buffer, &mut icon_data);
|
||||
homescreen_position_text(unwrap!(texts.first()), &mut text_buffer, &mut icon_data);
|
||||
|
||||
let mcu_height = data.get_height();
|
||||
data.decompress();
|
||||
@ -671,7 +671,7 @@ pub fn homescreen(
|
||||
}
|
||||
} else {
|
||||
next_text_idx += 1;
|
||||
homescreen_position_text(unwrap!(texts.get(0)), &mut text_buffer, &mut icon_data)
|
||||
homescreen_position_text(unwrap!(texts.first()), &mut text_buffer, &mut icon_data)
|
||||
};
|
||||
|
||||
set_window(screen());
|
||||
|
@ -32,7 +32,7 @@ use crate::{
|
||||
},
|
||||
Border, Component, Empty, FormattedText, Label, Never, Qr, Timeout,
|
||||
},
|
||||
display::{self, tjpgd::jpeg_info},
|
||||
display::tjpgd::jpeg_info,
|
||||
geometry,
|
||||
layout::{
|
||||
obj::{ComponentMsgObj, LayoutObj},
|
||||
@ -50,9 +50,9 @@ use super::{
|
||||
FidoMsg, Frame, FrameMsg, Homescreen, HomescreenMsg, IconDialog, Lockscreen, MnemonicInput,
|
||||
MnemonicKeyboard, MnemonicKeyboardMsg, NumberInputDialog, NumberInputDialogMsg,
|
||||
PassphraseKeyboard, PassphraseKeyboardMsg, PinKeyboard, PinKeyboardMsg, Progress,
|
||||
SelectWordCount, SelectWordCountMsg, SelectWordMsg, SimplePage, Slip39Input, WelcomeScreen,
|
||||
SelectWordCount, SelectWordCountMsg, SelectWordMsg, SimplePage, Slip39Input,
|
||||
},
|
||||
constant, theme,
|
||||
theme,
|
||||
};
|
||||
|
||||
impl TryFrom<CancelConfirmMsg> for Obj {
|
||||
|
Loading…
Reference in New Issue
Block a user