From 7311fe12032c24732659304e3e83111825c1898d Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Fri, 5 Jul 2024 07:31:24 +0900 Subject: [PATCH] use when-let for DRY --- cider-eldoc.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cider-eldoc.el b/cider-eldoc.el index 9a3266272..1137046bb 100644 --- a/cider-eldoc.el +++ b/cider-eldoc.el @@ -218,10 +218,9 @@ information." (symbol (lax-plist-get eldoc-info "symbol")) (docstring (or (cider--render-docstring-first-sentence eldoc-info) (cider--render-docstring eldoc-info) - (when (lax-plist-get eldoc-info "docstring") + (when-let (docstring (lax-plist-get eldoc-info "docstring")) (cider-docstring--trim - (cider-docstring--format - (lax-plist-get eldoc-info "docstring")))))) + (cider-docstring--format docstring))))) ;; if it's a single class (and not multiple class candidates), that's it (maybe-class (car (lax-plist-get eldoc-info "class"))) (formatted-var (or (when maybe-class