Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

another empty? recommendation #45

Merged
merged 1 commit into from

2 participants

@miner

No description provided.

@jonase jonase merged commit 9f4af6e into jonase:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  src/kibit/rules/collections.clj
@@ -8,6 +8,7 @@
;; empty?
[(not (empty? ?x)) (seq ?x)]
+ [(when-not (empty? ?x) . ?y) (when (seq ?x) . ?y)]
;; set
[(into #{} ?coll) (set ?coll)])
View
2  test/kibit/test/collections.clj
@@ -6,6 +6,8 @@
(are [expected-alt-form test-form]
(= expected-alt-form (:alt (kibit/check-expr test-form)))
'(seq a) '(not (empty? a))
+ '(when (seq a) b) '(when-not (empty? a) b)
+ '(when (seq a) b) '(when (not (empty? a)) b)
'(vector a) '(conj [] a)
'(vector a b) '(conj [] a b)
'(vec coll) '(into [] coll)
Something went wrong with that request. Please try again.