From 8cf039740f770b36e18c9a9e96b3f2b0ab66e77e Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 14 Jun 2024 13:56:08 +0200 Subject: [PATCH] style(core/rust): rustfmt --- .../src/ui/model_mercury/component/keyboard/pin.rs | 5 ++++- .../src/ui/model_mercury/component/keyboard/slip39.rs | 10 +++++----- .../rust/src/ui/model_mercury/theme/bootloader.rs | 3 ++- core/embed/rust/src/ui/model_mercury/theme/mod.rs | 3 ++- .../model_tr/component/input_methods/number_input.rs | 6 ++++-- .../rust/src/ui/model_tt/component/keyboard/pin.rs | 5 ++++- .../rust/src/ui/model_tt/component/keyboard/slip39.rs | 10 +++++----- core/embed/rust/src/ui/model_tt/theme/bootloader.rs | 3 ++- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/core/embed/rust/src/ui/model_mercury/component/keyboard/pin.rs b/core/embed/rust/src/ui/model_mercury/component/keyboard/pin.rs index 68c3574229..b82d56b0d3 100644 --- a/core/embed/rust/src/ui/model_mercury/component/keyboard/pin.rs +++ b/core/embed/rust/src/ui/model_mercury/component/keyboard/pin.rs @@ -14,7 +14,10 @@ use crate::{ event::TouchEvent, geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect}, model_mercury::component::{ - button::{Button, ButtonContent, ButtonMsg::{self, Clicked}}, + button::{ + Button, ButtonContent, + ButtonMsg::{self, Clicked}, + }, theme, }, shape::{self, Renderer}, diff --git a/core/embed/rust/src/ui/model_mercury/component/keyboard/slip39.rs b/core/embed/rust/src/ui/model_mercury/component/keyboard/slip39.rs index 60cfe425d2..a854f336f1 100644 --- a/core/embed/rust/src/ui/model_mercury/component/keyboard/slip39.rs +++ b/core/embed/rust/src/ui/model_mercury/component/keyboard/slip39.rs @@ -3,7 +3,9 @@ use core::iter; use heapless::String; use crate::{ - strutil::ShortString, trezorhal::slip39, ui::{ + strutil::ShortString, + trezorhal::slip39, + ui::{ component::{ text::common::{TextBox, TextEdit}, Component, Event, EventCtx, @@ -22,7 +24,7 @@ use crate::{ }, shape::{self, Renderer}, util::ResultExt, - } + }, }; const MAX_LENGTH: usize = 8; @@ -227,9 +229,7 @@ impl Slip39Input { } } - fn setup_from_prefilled_word( - word: &str, - ) -> (ShortString, Slip39Mask, Option<&'static str>) { + fn setup_from_prefilled_word(word: &str) -> (ShortString, Slip39Mask, Option<&'static str>) { let mut buff = ShortString::new(); // Gradually appending encoded key digits to the buffer and checking if diff --git a/core/embed/rust/src/ui/model_mercury/theme/bootloader.rs b/core/embed/rust/src/ui/model_mercury/theme/bootloader.rs index e97c985a8d..fd8c226b5d 100644 --- a/core/embed/rust/src/ui/model_mercury/theme/bootloader.rs +++ b/core/embed/rust/src/ui/model_mercury/theme/bootloader.rs @@ -2,7 +2,8 @@ use crate::ui::{ component::{text::TextStyle, LineBreaking::BreakWordsNoHyphen}, constant::{HEIGHT, WIDTH}, display::{Color, Font}, - geometry::{Offset, Point, Rect}, util::include_res, + geometry::{Offset, Point, Rect}, + util::include_res, }; use super::super::{ diff --git a/core/embed/rust/src/ui/model_mercury/theme/mod.rs b/core/embed/rust/src/ui/model_mercury/theme/mod.rs index 95fa66ec5c..79ca45ec3f 100644 --- a/core/embed/rust/src/ui/model_mercury/theme/mod.rs +++ b/core/embed/rust/src/ui/model_mercury/theme/mod.rs @@ -10,7 +10,8 @@ use crate::{ FixedHeightBar, }, display::{Color, Font}, - geometry::Insets, util::include_icon, + geometry::Insets, + util::include_icon, }, }; diff --git a/core/embed/rust/src/ui/model_tr/component/input_methods/number_input.rs b/core/embed/rust/src/ui/model_tr/component/input_methods/number_input.rs index b033007fbc..83f944bbe0 100644 --- a/core/embed/rust/src/ui/model_tr/component/input_methods/number_input.rs +++ b/core/embed/rust/src/ui/model_tr/component/input_methods/number_input.rs @@ -1,9 +1,11 @@ use crate::{ - strutil::ShortString, translations::TR, ui::{ + strutil::ShortString, + translations::TR, + ui::{ component::{Component, Event, EventCtx}, geometry::Rect, shape::Renderer, - } + }, }; use super::super::{ButtonLayout, ChoiceFactory, ChoiceItem, ChoicePage}; diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs index 8d1f4f6aa3..582a6c70cc 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs @@ -14,7 +14,10 @@ use crate::{ event::TouchEvent, geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect}, model_tt::component::{ - button::{Button, ButtonContent, ButtonMsg::{self, Clicked}}, + button::{ + Button, ButtonContent, + ButtonMsg::{self, Clicked}, + }, theme, }, shape::{self, Renderer}, diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs index 66f11e86cf..1b7d909b3e 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs @@ -3,7 +3,9 @@ use core::iter; use heapless::String; use crate::{ - strutil::ShortString, trezorhal::slip39, ui::{ + strutil::ShortString, + trezorhal::slip39, + ui::{ component::{ text::common::{TextBox, TextEdit}, Component, Event, EventCtx, @@ -22,7 +24,7 @@ use crate::{ }, shape::{self, Renderer}, util::ResultExt, - } + }, }; const MAX_LENGTH: usize = 8; @@ -286,9 +288,7 @@ impl Slip39Input { } } - fn setup_from_prefilled_word( - word: &str, - ) -> (ShortString, Slip39Mask, Option<&'static str>) { + fn setup_from_prefilled_word(word: &str) -> (ShortString, Slip39Mask, Option<&'static str>) { let mut buff = ShortString::new(); // Gradually appending encoded key digits to the buffer and checking if diff --git a/core/embed/rust/src/ui/model_tt/theme/bootloader.rs b/core/embed/rust/src/ui/model_tt/theme/bootloader.rs index 600b2b1b5d..c132c54f32 100644 --- a/core/embed/rust/src/ui/model_tt/theme/bootloader.rs +++ b/core/embed/rust/src/ui/model_tt/theme/bootloader.rs @@ -6,7 +6,8 @@ use crate::ui::{ model_tt::{ component::{ButtonStyle, ButtonStyleSheet, ResultStyle}, theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE}, - }, util::include_res, + }, + util::include_res, }; pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD);