From d85b49b02945e81cee9c0b54a594601515d2109c Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Sat, 4 Feb 2023 08:28:48 +0200 Subject: [PATCH] -loc --- src/malli/experimental.cljc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/malli/experimental.cljc b/src/malli/experimental.cljc index 4d27429fe..dbf7f137c 100644 --- a/src/malli/experimental.cljc +++ b/src/malli/experimental.cljc @@ -36,9 +36,7 @@ (def Params (-schema false)) (c/defn -defn [schema args] - (let [{:keys [name return doc arities] - body-meta :meta - :as parsed} (m/parse schema args) + (let [{:keys [name return doc arities] body-meta :meta :as parsed} (m/parse schema args) var-meta (meta name) _ (when (= ::m/invalid parsed) (m/-fail! ::parse-error {:schema schema, :args args})) parse (fn [{:keys [args] :as parsed}] (merge (md/parse args) parsed)) @@ -48,8 +46,7 @@ raw-arglists (map :raw-arglist parglists) schema (as-> (map ->schema parglists) $ (if single (first $) (into [:function] $))) bodies (map (fn [{:keys [arglist prepost body]}] `(~arglist ~prepost ~@body)) parglists) - validate? (or (:malli/always var-meta) - (:malli/always body-meta)) + validate? (or (:malli/always var-meta) (:malli/always body-meta)) enriched-meta (assoc body-meta :raw-arglists (list 'quote raw-arglists) :schema schema)] `(let [defn# ~(if validate? `(def @@ -57,9 +54,7 @@ enriched-meta {:arglists (list 'quote (map :arglist parglists))})) ~@(some-> doc vector) - (m/-instrument - {:schema ~schema} - (fn ~(gensym (str name "-instrumented")) ~@bodies))) + (m/-instrument {:schema ~schema} (fn ~(gensym (str name "-instrumented")) ~@bodies))) `(c/defn ~name ~@(some-> doc vector)