From f246eaece0b8885f64856bee93c87a0e2b5e5976 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Fri, 5 Jan 2018 01:15:09 +0100 Subject: remove println!() and sleep during the loop --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b404cfa..4632f6f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,13 +61,11 @@ fn indicate_battery_level(level: u32) -> Result<()> { Ok(()) } -#[allow(unused)] fn main() { loop { let p = read_battery_percentage(); match p { Ok(level) => { - println!("Battery Level: {}", level); if level < 20 { match indicate_battery_level(level) { Err(e) => panic!("Error: {}", e), @@ -77,5 +75,6 @@ fn main() { } Err(e) => panic!("Error: {}", e), } + sleep(Duration::from_secs(10)); } } \ No newline at end of file -- cgit v1.2.1