guix-commits
[Top][All Lists]
Advanced

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

07/80: installer: Use ice-9 match.


From: John Darrington
Subject: 07/80: installer: Use ice-9 match.
Date: Tue, 3 Jan 2017 15:49:41 +0000 (UTC)

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

commit 0afe28a3ebf01822a0a4d227a374f5269d2d89c6
Author: John Darrington <address@hidden>
Date:   Sun Dec 18 08:14:14 2016 +0100

    installer: Use ice-9 match.
    
    * gnu/system/installer/network.scm (interfaces): Use match instead of cadr.
---
 gnu/system/installer/network.scm |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gnu/system/installer/network.scm b/gnu/system/installer/network.scm
index ada4f28..1aa193b 100644
--- a/gnu/system/installer/network.scm
+++ b/gnu/system/installer/network.scm
@@ -37,11 +37,13 @@
 
 
 (define interfaces (delete "lo"
-                            (slurp "ip -o link"
-                                   (lambda (s)
-                                     (string-trim-both
-                                      (cadr (string-split s #\:))
-                                      char-set:whitespace)))))
+                           (slurp "ip -o link"
+                                  (lambda (s)
+                                    (match (string-split s #\:)
+                                      ((_ interface-name . _)
+                                       (string-trim-both
+                                        interface-name
+                                        char-set:whitespace)))))))
 
 (define my-buttons `((continue ,(N_ "_Continue") #t)
                     (test     ,(N_ "_Test") #t)))



reply via email to

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