1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-29 18:08:19 +00:00

rust: allow dead code for actualy used things or those potentially useful in the future

This commit is contained in:
grdddj 2023-04-10 12:08:32 +02:00
parent 10919e0b6c
commit fc1493a12d
7 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,7 @@ pub unsafe fn try_or_raise<T>(func: impl FnOnce() -> Result<T, Error>) -> T {
/// Extract kwargs from a C call and pass them into Rust. Raise exception if an /// Extract kwargs from a C call and pass them into Rust. Raise exception if an
/// error occurs. Should only called when returning from Rust to C. See /// error occurs. Should only called when returning from Rust to C. See
/// `raise_exception` for details. /// `raise_exception` for details.
#[allow(dead_code)]
pub unsafe fn try_with_kwargs( pub unsafe fn try_with_kwargs(
kwargs: *const Map, kwargs: *const Map,
func: impl FnOnce(&Map) -> Result<Obj, Error>, func: impl FnOnce(&Map) -> Result<Obj, Error>,

View File

@ -1,3 +1,5 @@
#![allow(dead_code)]
use crate::trezorhal::storage::{get, get_length}; use crate::trezorhal::storage::{get, get_length};
pub const HOMESCREEN_MAX_SIZE: usize = 16384; pub const HOMESCREEN_MAX_SIZE: usize = 16384;

View File

@ -1,5 +1,6 @@
use super::ffi; use super::ffi;
#[allow(dead_code)]
pub fn dma2d_setup_4bpp(fg_color: u16, bg_color: u16) { pub fn dma2d_setup_4bpp(fg_color: u16, bg_color: u16) {
unsafe { ffi::dma2d_setup_4bpp(fg_color, bg_color) } unsafe { ffi::dma2d_setup_4bpp(fg_color, bg_color) }
} }
@ -12,6 +13,7 @@ pub fn dma2d_setup_4bpp_over_16bpp(overlay_color: u16) {
unsafe { ffi::dma2d_setup_4bpp_over_16bpp(overlay_color) } unsafe { ffi::dma2d_setup_4bpp_over_16bpp(overlay_color) }
} }
#[allow(dead_code)]
pub fn dma2d_start(buffer: &[u8], pixels: i16) { pub fn dma2d_start(buffer: &[u8], pixels: i16) {
unsafe { unsafe {
ffi::dma2d_start( ffi::dma2d_start(

View File

@ -1,3 +1,5 @@
#![allow(dead_code)]
use super::ffi; use super::ffi;
pub fn set_color(color: u32) { pub fn set_color(color: u32) {

View File

@ -1,3 +1,5 @@
#![allow(dead_code)]
use super::ffi; use super::ffi;
use crate::error::Error; use crate::error::Error;
use core::ptr; use core::ptr;

View File

@ -1,3 +1,5 @@
#![allow(dead_code)] // clippy marks these unused, as they are only for TR
use crate::ui::{ use crate::ui::{
constant::{screen, LOADER_INNER}, constant::{screen, LOADER_INNER},
display, display,

View File

@ -1,3 +1,5 @@
#![allow(dead_code)] // clippy marks these unused, as they are only for TR
use crate::ui::{ use crate::ui::{
constant::{screen, LOADER_OUTER}, constant::{screen, LOADER_OUTER},
display::{rect_fill, rect_fill_rounded, rect_fill_rounded1, Color, Icon}, display::{rect_fill, rect_fill_rounded, rect_fill_rounded1, Color, Icon},