Subject: [PATCH 3/6] import: npm-binary: Improve-style.

From: Nicolas Graves <[email-masked]>
Date: Mon, 24 Mar 2025 08:29:14 +0100

* guix/import/binary.scm (resolve-package): Use and-let*.
---
 guix/import/npm-binary.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/guix/import/npm-binary.scm b/guix/import/npm-binary.scm
index f095651c34..60d7c07a8e 100644
--- a/guix/import/npm-binary.scm
+++ b/guix/import/npm-binary.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019, 2020 Timothy Sample <[email-masked]>
 ;;; Copyright © 2021 Lars-Dominik Braun <[email-masked]>
 ;;; Copyright © 2020, 2023, 2024 Jelle Licht <[email-masked]>
+;;; Copyright © 2025 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@ (define-module (guix import npm-binary)
   #:use-module (ice-9 regex)
   #:use-module (json)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-41)
   #:use-module (srfi srfi-9)
@@ -158,11 +160,11 @@ (define* (semver-latest svs #:optional (svr *semver-range-any*))
         (sort svs semver>?)))
 
 (define* (resolve-package name #:optional (svr *semver-range-any*))
-  (let ((meta (lookup-meta-package* name)))
-    (and meta
-         (let* ((version (semver-latest (or (meta-package-versions meta) '()) svr))
-                (pkg (meta-package-package meta version)))
-           pkg))))
+  (and-let*
+      ((meta (lookup-meta-package* name))
+       (version (semver-latest (or (meta-package-versions meta) '()) svr))
+       (pkg (meta-package-package meta version)))
+    pkg))
 
 
 ;;;
-- 
2.48.1