diff options
| author | eltrac <hi@eltr.ac> | 2026-03-10 09:37:13 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-10 09:37:13 +0800 |
| commit | 0c1977ba5d4398d9c188874f91c20a2b8ef48e46 (patch) | |
| tree | fba635cea1a223e0d38cd0d543c9dda19a348080 /src | |
| parent | 14c3fe33f59089af1ff89ee931ff6e9338c7f801 (diff) | |
refactor: remove `with-this-wm` function
Diffstat (limited to 'src')
| -rw-r--r-- | src/weepinbell/storage.clj | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/weepinbell/storage.clj b/src/weepinbell/storage.clj index 46222de..7d847d3 100644 --- a/src/weepinbell/storage.clj +++ b/src/weepinbell/storage.clj @@ -27,12 +27,6 @@ (= target (get-in % [:webmention :target])))] (first (filter pred data)))) -(defn with-this-wm - "Do something with this Webmention (identified by source and target)." - [source target do-something-with] - (when-let [this-wm (get-wm source target)] - (do-something-with this-wm))) - (defn first-line-empty? [path] (with-open [rdr (io/reader path)] (let [line (line-seq rdr)] @@ -53,10 +47,8 @@ (defn delete-wm "Delete a Webmention entry by source and target." [source target] - (with-this-wm source target - (fn [this-wm] - (->> (load-data) - (remove #(= this-wm %)) - vec - unload-data)))) + (when-let [wm (get-wm source target)] + (->> (load-data) + (remove #(= wm %)) + unload-data))) |
