Skip to content

Commit

Permalink
use when-let for DRY
Browse files Browse the repository at this point in the history
  • Loading branch information
conao3 committed Jul 4, 2024
1 parent 1f8a041 commit 7311fe1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cider-eldoc.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7311fe1

Please sign in to comment.