From 45b6672c641ff1d5a7f52fb7ee202acc461995c1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 15 May 2025 20:10:23 +0300 Subject: [PATCH] battery: avoid manual flatten; capture each Err --- src/battery.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/battery.rs b/src/battery.rs index 4dd9be3..645eaa1 100644 --- a/src/battery.rs +++ b/src/battery.rs @@ -95,7 +95,14 @@ fn find_supported_batteries(power_supply_path: &Path) -> Result e, + Err(e) => { + warn!("Failed to read power-supply entry: {e}"); + continue; + } + }; let ps_path = entry.path(); if is_battery(&ps_path)? { if let Some(battery) = find_battery_with_threshold_support(&ps_path) {