Pi66

walrs
pywal but if its Fast-Minimal-Simple
git clone https://git.pi66.xyz/walrs

← back to log

fix let-else syntax compatibility in environment detection

author: pixel2175
date: 2025-06-06 15:36
hash: 4054eba1885d785114200bb58ebb13189101a1ae

Diffstat:

M

src/wallpaper.rs
5 ++++++++++++++++++------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/src/wallpaper.rs b/src/wallpaper.rs
index cae0ce4..b0a9541 100644
--- a/src/wallpaper.rs
+++ b/src/wallpaper.rs
@@ -69,8 +69,8 @@ fn get_desktop_env() -> Option<String> {

     // Check for other environment variables
     for key in keys.iter() {
-        if let Ok(val) = env::var(key)
-            && !val.is_empty() {
+        if let Ok(val) = env::var(key) {
+            if !val.is_empty() {
                 if *key == "DESKTOP_STARTUP_ID" && val.contains("awesome") {
                     return Some("AWESOME".to_string());
                 }
@@ -83,6 +83,7 @@ fn get_desktop_env() -> Option<String> {
                     return Some(val);
                 }
             }
+        }
     }
     None
 }