mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
Replace with when-let since no else branches
This commit is contained in:
parent
93e288bf34
commit
673f6dec72
1 changed files with 2 additions and 2 deletions
|
|
@ -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))))
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue