Skip to content

Commit e316b2e

Browse files
committed
Surround io/reader in update-doc! with with-open
1 parent 3d507b9 commit e316b2e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clj/src/vim_clojure_static/generate.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,11 @@
309309
(string/replace (apply str xs) "\\" "\\\\"))
310310

311311
(defn- update-doc! [first-line-pattern src-file dst-file]
312-
(let [sbuf (->> src-file
313-
io/reader
314-
line-seq
315-
(drop-while #(not (re-find first-line-pattern %)))
316-
(string/join \newline))
312+
(let [sbuf (with-open [rdr (io/reader src-file)]
313+
(->> rdr
314+
line-seq
315+
(drop-while #(not (re-find first-line-pattern %)))
316+
(string/join \newline)))
317317
dbuf (slurp dst-file)
318318
dmatch (re-find CLOJURE-SECTION dbuf)
319319
hunk (re-find CLOJURE-SECTION sbuf)]

0 commit comments

Comments
 (0)