From dddbaab6207fcc6d406d8f6a1e68f6c072c6a715 Mon Sep 17 00:00:00 2001 From: Jonathan Jin Date: Sat, 11 Jan 2025 11:23:30 -0500 Subject: [PATCH] if-let -> if-let* --- kele.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kele.el b/kele.el index cbe89c9e..d9f26614 100644 --- a/kele.el +++ b/kele.el @@ -762,8 +762,8 @@ to complete. Returned value may not be up to date." (defun kele--context-cluster-name (context-name) "Get the name of the cluster of the context named CONTEXT-NAME." - (if-let ((context (-first (lambda (elem) (string= (alist-get 'name elem) context-name)) - (alist-get 'contexts (oref kele--global-kubeconfig-cache contents))))) + (if-let* ((context (-first (lambda (elem) (string= (alist-get 'name elem) context-name)) + (alist-get 'contexts (oref kele--global-kubeconfig-cache contents))))) (alist-get 'cluster (alist-get 'context context)) (error "Could not find context of name %s" context-name))) @@ -961,7 +961,7 @@ If value is nil, the namespaces need to be fetched directly.") If the namespaces are cached, return the cached value. If CACHE is non-nil, cache the fetched namespaces." - (if-let ((cached-namespaces (alist-get (intern context) kele--namespaces-cache))) + (if-let* ((cached-namespaces (alist-get (intern context) kele--namespaces-cache))) cached-namespaces (let* ((gvk (kele--gvk-create :version "v1" :kind "namespaces")) (namespaces (kele--fetch-resource-names gvk :context context))) @@ -1425,7 +1425,7 @@ Assumes that the current Transient prefix's :scope is an alist w/ `context' key. ;; FIXME: Make this resilient to the prefix's scope not having a context ;; value. If not present (or the scope is not an alist or the scope is not ;; defined), default to current context. - (if-let ((context (alist-get 'context (oref transient--prefix scope)))) + (if-let* ((context (alist-get 'context (oref transient--prefix scope)))) (kele--namespaces-complete :context context :prompt prompt