Skip to content

Commit

Permalink
replace pr-to-writer with print-method
Browse files Browse the repository at this point in the history
  • Loading branch information
nvlass committed Jan 9, 2025
1 parent bee6aae commit 4027da7
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions modules/muuntaja/src/muuntaja/format/edn.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,13 @@
(decode [_ data charset]
(edn/read options (PushbackReader. (InputStreamReader. ^InputStream data ^String charset)))))))

(defn- pr-to-writer
([w] w)
([w x]
(print-method x w)
w)
([w x & more]
(print-method x w)
(.append w \space)
(if-let [nmore (next more)]
(recur w (first more) nmore)
(apply pr-to-writer more))))

(defn encoder [_]
(reify
core/EncodeToBytes
(encode-to-bytes [_ data charset]
(.getBytes
(let [w (new java.io.StringWriter)]
(pr-to-writer w data)
(print-method data w)
(.toString w))
^String charset))
core/EncodeToOutputStream
Expand Down

0 comments on commit 4027da7

Please sign in to comment.