From 2539d1ab887fcc9545a10de6b5c31a5d8a11510b Mon Sep 17 00:00:00 2001 From: Greg Look Date: Sun, 11 Oct 2015 19:57:30 -0700 Subject: [PATCH] Use case instead of cond in visit-unknown. --- src/puget/printer.clj | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/puget/printer.clj b/src/puget/printer.clj index 1252ccf..67d6832 100644 --- a/src/puget/printer.clj +++ b/src/puget/printer.clj @@ -330,21 +330,20 @@ (visit-unknown [this value] - (cond - (= :pretty print-fallback) + (case print-fallback + :pretty (format-unknown this value) - (= :print print-fallback) + :print [:span (pr-str value)] - (= :error print-fallback) + :error (throw (IllegalArgumentException. (str "No defined representation for " (class value) ": " (pr-str value)))) - (ifn? print-fallback) + (if (ifn? print-fallback) (print-fallback this value) - :else (throw (IllegalStateException. (str "Unsupported value for print-fallback: " - (pr-str value))))))) + (pr-str print-fallback))))))))