From acf87e4fc46df4097f43c18721ec4345b065e039 Mon Sep 17 00:00:00 2001 From: Chleba Date: Tue, 12 Mar 2024 14:10:30 +0100 Subject: [PATCH] add sorting WiFi networks by it's signal strength --- src/components/wifi_scan.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/wifi_scan.rs b/src/components/wifi_scan.rs index 5507f8c..0c27445 100644 --- a/src/components/wifi_scan.rs +++ b/src/components/wifi_scan.rs @@ -210,6 +210,8 @@ impl WifiScan { self.wifis.push(w.clone()); } } + // -- sort wifi networks by it's signal strength + self.wifis.sort_by(|a, b| b.signal.partial_cmp(&a.signal).unwrap()); } fn app_tick(&mut self) -> Result<()> {