Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperq committed Jun 17, 2024
1 parent ebdd32a commit 60cbdef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ 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: Option<&[u8]> = None;
let mut img: Option<&[u8]> = None;
if display_level == 2 {
img = Some(IMAGE_DIR.get_file("orca.gif").expect("failed to read orca.gif").contents());
} else if display_level == 3 {
Expand All @@ -150,9 +150,6 @@ async fn update_ui(task_tracker: &TaskTracker, config: &config::Config, mut ui_

}
match display_level {
1 | _ => {
fb.draw_line(framebuffer::Color565::Green, 2);
},
2 => {
fb.draw_gif(img.unwrap());
},
Expand All @@ -166,6 +163,9 @@ 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);
},
1 | _ => {
fb.draw_line(framebuffer::Color565::Green, 2);
},
};
sleep(Duration::from_millis(100));
}
Expand Down

0 comments on commit 60cbdef

Please sign in to comment.