Pi66

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

← back to log

fix let-else syntax and function scope

author: pixel2175
date: 2025-06-06 15:33
hash: 5f7f867377ca0956f97adbfe32649031714e90e8

Diffstat:

M

src/utils.rs
12 ++++++++++++++++++------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/src/utils.rs b/src/utils.rs
index d86088c..657b06f 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -51,14 +51,16 @@ pub fn run(command: &str) -> bool {
 }

 pub fn print_colors(send: bool) {
-    if send
-        && let Ok(output) = Command::new("bash")
+    if send {
+        if let Ok(output) = Command::new("bash")
             .arg("-c")
             .arg(r#"for i in {30..37} 90; do echo -en "\033[0;${i}m●\033[0m "; done; echo"#)
             .output()
-        && output.status.success()
-    {
-        print!("{}", String::from_utf8_lossy(&output.stdout));
+        {
+            if output.status.success() {
+                print!("{}", String::from_utf8_lossy(&output.stdout));
+            }
+        }
     }
 }