mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-27 16:09:58 -07:00
Apply suggestions from code review
Co-authored-by: Will Greenberg <willg@eff.org>
This commit is contained in:
@@ -133,13 +133,11 @@ async fn update_ui(task_tracker: &TaskTracker, config: &config::Config, mut ui_
|
||||
task_tracker.spawn_blocking(move || {
|
||||
let mut fb: Framebuffer = Framebuffer::new();
|
||||
// this feels wrong, is there a more rusty way to do this?
|
||||
let img;
|
||||
let img: Option<&[u8]> = None;
|
||||
if display_level == 2 {
|
||||
img = IMAGE_DIR.get_file("orca.gif").unwrap().contents();
|
||||
} else if display_level == 3{
|
||||
img = IMAGE_DIR.get_file("eff.png").unwrap().contents();
|
||||
} else {
|
||||
img = &[];
|
||||
img = Some(IMAGE_DIR.get_file("orca.gif").expect("failed to read orca.gif").contents());
|
||||
} else if display_level == 3 {
|
||||
img = Some(IMAGE_DIR.get_file("eff.png").expect("failed to read eff.png").contents());
|
||||
}
|
||||
loop {
|
||||
match ui_shutdown_rx.try_recv() {
|
||||
@@ -152,7 +150,7 @@ async fn update_ui(task_tracker: &TaskTracker, config: &config::Config, mut ui_
|
||||
|
||||
}
|
||||
match display_level {
|
||||
1 => {
|
||||
1 | _ => {
|
||||
fb.draw_line(framebuffer::Color565::Green, 2);
|
||||
},
|
||||
2 => {
|
||||
@@ -168,9 +166,6 @@ async fn update_ui(task_tracker: &TaskTracker, config: &config::Config, mut ui_
|
||||
fb.draw_line(framebuffer::Color565::Pink, 50);
|
||||
fb.draw_line(framebuffer::Color565::Cyan, 25);
|
||||
},
|
||||
_ => {
|
||||
fb.draw_line(framebuffer::Color565::Green, 2);
|
||||
}
|
||||
};
|
||||
sleep(Duration::from_millis(100));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user