mirror of
https://github.com/metosin/reitit.git
synced 2026-02-01 10:20:35 +00:00
refactor: Remove redundant let
This commit is contained in:
parent
3191d9ee59
commit
e6137cb47a
2 changed files with 10 additions and 10 deletions
|
|
@ -22,12 +22,12 @@
|
||||||
compile (fn [[path data] opts scope]
|
compile (fn [[path data] opts scope]
|
||||||
(interceptor/compile-result [path data] opts scope))
|
(interceptor/compile-result [path data] opts scope))
|
||||||
->endpoint (fn [p d m s]
|
->endpoint (fn [p d m s]
|
||||||
(let [d (ring/-compile-coercion d)]
|
(let [d (ring/-compile-coercion d)
|
||||||
(let [compiled (compile [p d] opts s)]
|
compiled (compile [p d] opts s)]
|
||||||
(-> compiled
|
(-> compiled
|
||||||
(map->Endpoint)
|
(map->Endpoint)
|
||||||
(assoc :path p)
|
(assoc :path p)
|
||||||
(assoc :method m)))))
|
(assoc :method m))))
|
||||||
->methods (fn [any? data]
|
->methods (fn [any? data]
|
||||||
(reduce
|
(reduce
|
||||||
(fn [acc method]
|
(fn [acc method]
|
||||||
|
|
|
||||||
|
|
@ -308,10 +308,10 @@
|
||||||
["/ping" {:get {:interceptors [{:enter #(a/go %)}]
|
["/ping" {:get {:interceptors [{:enter #(a/go %)}]
|
||||||
:handler (fn [_] (a/go response))}}])
|
:handler (fn [_] (a/go response))}}])
|
||||||
(ring/create-default-handler)
|
(ring/create-default-handler)
|
||||||
{:executor sieppari/executor})]
|
{:executor sieppari/executor})
|
||||||
(let [respond (promise)]
|
respond (promise)]
|
||||||
(app {:request-method :get, :uri "/ping"} respond ::irrelevant)
|
(app {:request-method :get, :uri "/ping"} respond ::irrelevant)
|
||||||
(is (= response (deref respond 100 ::timeout)))))))
|
(is (= response (deref respond 100 ::timeout))))))
|
||||||
|
|
||||||
(defrecord MyAsyncContext [])
|
(defrecord MyAsyncContext [])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue