From 6c835e6e09284382c5b921ebc258ae598113f779 Mon Sep 17 00:00:00 2001 From: Michael Salihi Date: Wed, 13 Oct 2021 18:50:20 +0200 Subject: [PATCH] Replace if-let by when-let since no else branches for the recursive match by path example. --- 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 46be98f7..d6db2426 100644 --- a/doc/advanced/composing_routers.md +++ b/doc/advanced/composing_routers.md @@ -143,10 +143,10 @@ As the `Match` contains all the route data, we can create a new matching functio (require '[clojure.string :as str]) (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)))) ```