1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-06 10:16:07 +00:00

style(core/rust): rustfmt

This commit is contained in:
matejcik 2024-06-14 13:56:08 +02:00 committed by matejcik
parent 8e52081d8a
commit 8cf039740f
8 changed files with 28 additions and 17 deletions

View File

@ -14,7 +14,10 @@ use crate::{
event::TouchEvent, event::TouchEvent,
geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect}, geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect},
model_mercury::component::{ model_mercury::component::{
button::{Button, ButtonContent, ButtonMsg::{self, Clicked}}, button::{
Button, ButtonContent,
ButtonMsg::{self, Clicked},
},
theme, theme,
}, },
shape::{self, Renderer}, shape::{self, Renderer},

View File

@ -3,7 +3,9 @@ use core::iter;
use heapless::String; use heapless::String;
use crate::{ use crate::{
strutil::ShortString, trezorhal::slip39, ui::{ strutil::ShortString,
trezorhal::slip39,
ui::{
component::{ component::{
text::common::{TextBox, TextEdit}, text::common::{TextBox, TextEdit},
Component, Event, EventCtx, Component, Event, EventCtx,
@ -22,7 +24,7 @@ use crate::{
}, },
shape::{self, Renderer}, shape::{self, Renderer},
util::ResultExt, util::ResultExt,
} },
}; };
const MAX_LENGTH: usize = 8; const MAX_LENGTH: usize = 8;
@ -227,9 +229,7 @@ impl Slip39Input {
} }
} }
fn setup_from_prefilled_word( fn setup_from_prefilled_word(word: &str) -> (ShortString, Slip39Mask, Option<&'static str>) {
word: &str,
) -> (ShortString, Slip39Mask, Option<&'static str>) {
let mut buff = ShortString::new(); let mut buff = ShortString::new();
// Gradually appending encoded key digits to the buffer and checking if // Gradually appending encoded key digits to the buffer and checking if

View File

@ -2,7 +2,8 @@ use crate::ui::{
component::{text::TextStyle, LineBreaking::BreakWordsNoHyphen}, component::{text::TextStyle, LineBreaking::BreakWordsNoHyphen},
constant::{HEIGHT, WIDTH}, constant::{HEIGHT, WIDTH},
display::{Color, Font}, display::{Color, Font},
geometry::{Offset, Point, Rect}, util::include_res, geometry::{Offset, Point, Rect},
util::include_res,
}; };
use super::super::{ use super::super::{

View File

@ -10,7 +10,8 @@ use crate::{
FixedHeightBar, FixedHeightBar,
}, },
display::{Color, Font}, display::{Color, Font},
geometry::Insets, util::include_icon, geometry::Insets,
util::include_icon,
}, },
}; };

View File

@ -1,9 +1,11 @@
use crate::{ use crate::{
strutil::ShortString, translations::TR, ui::{ strutil::ShortString,
translations::TR,
ui::{
component::{Component, Event, EventCtx}, component::{Component, Event, EventCtx},
geometry::Rect, geometry::Rect,
shape::Renderer, shape::Renderer,
} },
}; };
use super::super::{ButtonLayout, ChoiceFactory, ChoiceItem, ChoicePage}; use super::super::{ButtonLayout, ChoiceFactory, ChoiceItem, ChoicePage};

View File

@ -14,7 +14,10 @@ use crate::{
event::TouchEvent, event::TouchEvent,
geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect}, geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect},
model_tt::component::{ model_tt::component::{
button::{Button, ButtonContent, ButtonMsg::{self, Clicked}}, button::{
Button, ButtonContent,
ButtonMsg::{self, Clicked},
},
theme, theme,
}, },
shape::{self, Renderer}, shape::{self, Renderer},

View File

@ -3,7 +3,9 @@ use core::iter;
use heapless::String; use heapless::String;
use crate::{ use crate::{
strutil::ShortString, trezorhal::slip39, ui::{ strutil::ShortString,
trezorhal::slip39,
ui::{
component::{ component::{
text::common::{TextBox, TextEdit}, text::common::{TextBox, TextEdit},
Component, Event, EventCtx, Component, Event, EventCtx,
@ -22,7 +24,7 @@ use crate::{
}, },
shape::{self, Renderer}, shape::{self, Renderer},
util::ResultExt, util::ResultExt,
} },
}; };
const MAX_LENGTH: usize = 8; const MAX_LENGTH: usize = 8;
@ -286,9 +288,7 @@ impl Slip39Input {
} }
} }
fn setup_from_prefilled_word( fn setup_from_prefilled_word(word: &str) -> (ShortString, Slip39Mask, Option<&'static str>) {
word: &str,
) -> (ShortString, Slip39Mask, Option<&'static str>) {
let mut buff = ShortString::new(); let mut buff = ShortString::new();
// Gradually appending encoded key digits to the buffer and checking if // Gradually appending encoded key digits to the buffer and checking if

View File

@ -6,7 +6,8 @@ use crate::ui::{
model_tt::{ model_tt::{
component::{ButtonStyle, ButtonStyleSheet, ResultStyle}, component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE}, theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE},
}, util::include_res, },
util::include_res,
}; };
pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD); pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD);