svartalf / rust-battery

Rust crate providing cross-platform information about the notebook batteries.
https://crates.io/crates/battery
Apache License 2.0
354 stars 40 forks source link

Infinite recursion possibility at Linux implementation #30

Closed svartalf closed 5 years ago

svartalf commented 5 years ago

Reference: https://github.com/svartalf/rust-battery/blob/34612e0b600d4e0916ff16f3d0326ec067babbe7/battery/src/platform/linux/sysfs/source.rs#L175-L183

First of all, upower sources should be checked, since they were used as an knowledge source. If nothing helpful can be borrowed from them, plain error should be returned there instead of calling the same one function.