guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

39/197: installer: Replace an instance of cdr with match.


From: Danny Milosavljevic
Subject: 39/197: installer: Replace an instance of cdr with match.
Date: Mon, 3 Jul 2017 20:36:56 -0400 (EDT)

dannym pushed a commit to branch wip-installer-2
in repository guix.

commit 540321efc19274164a75890b2af4fc9df91cd5e3
Author: John Darrington <address@hidden>
Date:   Tue Dec 27 07:58:31 2016 +0100

    installer: Replace an instance of cdr with match.
    
    * gnu/system/installer/wireless.scm (scan-wifi): Use match instead of cdr.
---
 gnu/system/installer/wireless.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/system/installer/wireless.scm 
b/gnu/system/installer/wireless.scm
index 3eeb532..5e04acf 100644
--- a/gnu/system/installer/wireless.scm
+++ b/gnu/system/installer/wireless.scm
@@ -174,7 +174,9 @@ network={
    "" s))
 
 (define (scan-wifi ifce)
-  (cdr (slurp (string-append "iwlist " ifce " scan") string-trim-both)))
+  (match  (slurp (string-append "iwlist " ifce " scan") string-trim-both)
+    (#f '())
+    ((_ . lines) lines))) ;; Ignore the first line
 
 (define (drop-prefix pfx s)
   "Drop PFX from S if it is the first string"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]