@@ -1,3 +1,4 @@
+use std::cmp;
use std::fs::File;
use std::io::SeekFrom;
use std::io::prelude::*;
@@ -55,7 +56,7 @@ impl Sensor for BatterySensor {
}
fn status(&self) -> String {
- format!("{}%", self.percentage)
+ format!("{}%", cmp::min(100, self.percentage))
fn process(&mut self) {