1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

refactor(core/rust): simplify match statement in footer.rs

This commit is contained in:
matejcik 2024-09-11 10:36:01 +02:00 committed by matejcik
parent f7ce99e7d7
commit 85d699a42d

View File

@ -170,17 +170,13 @@ impl<'a> Component for Footer<'a> {
self.progress = 0;
}
Event::Swipe(SwipeEvent::Move(dir, progress)) => match dir {
Direction::Up => {
if self.swipe_allow_up {
self.progress = progress;
self.dir = dir;
}
Direction::Up if self.swipe_allow_up => {
self.progress = progress;
self.dir = dir;
}
Direction::Down => {
if self.swipe_allow_down {
self.progress = progress;
self.dir = dir;
}
Direction::Down if self.swipe_allow_down => {
self.progress = progress;
self.dir = dir;
}
_ => {}
},