From 4f83d10cf86bcc4c2364e7f5f24be34712242b04 Mon Sep 17 00:00:00 2001 From: mustafa salih Date: Sat, 16 Jan 2021 09:26:06 +0300 Subject: added some checks --- src/utils/battery.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/utils/battery.rs') diff --git a/src/utils/battery.rs b/src/utils/battery.rs index b831773..a38d3b4 100644 --- a/src/utils/battery.rs +++ b/src/utils/battery.rs @@ -16,7 +16,6 @@ pub fn get_battery(config: &Config) -> Result { let mut buf = String::new(); - // FIXME: ugly error handling AGAIN fixing later, im lazy match File::open(&battery_full_cap_file) { Ok(mut file) => file.read_to_string(&mut buf)?, Err(_) => return Ok(String::from("check your battery source name")), @@ -24,7 +23,7 @@ pub fn get_battery(config: &Config) -> Result { let full_design = buf.trim().parse::().unwrap(); buf.clear(); - // NOTE: no need to error check if passed the above match + // No need to error check if passed the above match File::open(&battery_charge_now_file)?.read_to_string(&mut buf)?; let charge_now = buf.trim().parse::().unwrap(); -- cgit v1.2.3