From 673f6dec72a883aa60b3115b5008274d331cc925 Mon Sep 17 00:00:00 2001 From: Michael Salihi Date: Thu, 9 Dec 2021 10:48:59 +0100 Subject: [PATCH] Replace with when-let since no else branches --- doc/advanced/composing_routers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/advanced/composing_routers.md b/doc/advanced/composing_routers.md index d6db2426..4a0f37c9 100644 --- a/doc/advanced/composing_routers.md +++ b/doc/advanced/composing_routers.md @@ -206,10 +206,10 @@ First, we need to modify our matching function to support router references: (deref x) x)) (defn recursive-match-by-path [router path] - (if-let [match (r/match-by-path (<< router) path)] + (when-let [match (r/match-by-path (<< router) path)] (if-let [subrouter (-> match :data :router <<)] (let [subpath (subs path (str/last-index-of (:template match) "/"))] - (if-let [submatch (recursive-match-by-path subrouter subpath)] + (when-let [submatch (recursive-match-by-path subrouter subpath)] (cons match submatch))) (list match)))) ```