-
Notifications
You must be signed in to change notification settings - Fork 17
Fix lein eastwood warnings and some typos #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Please take a look at my comments.
@@ -1,10 +1,8 @@ | |||
(ns digest | |||
#^{ :author "Miki Tebeka <miki.tebeka@gmail.com>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the meta data (OK for my name, but the doc?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm sorry about removing your name and doc from require - i executed lein slamhound
in project folder which optimised the require but also removed the meta data. Will restore it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(:require .. :refer ..)
is a new way to do the same thing that allows effectively deprecate :use
, which has some drawbacks. Please see https://stackoverflow.com/questions/871997/difference-between-use-and-require#comment25370819_16429572 for more details.
README.md
Outdated
@@ -27,7 +27,7 @@ namespace. Each can handle the following input types: | |||
"163883d3e0e3b0c028d35b626b98564be8d9d649ed8adb8b929cb8c94c735c59" | |||
|
|||
# Installation | |||
Add `[digest "1.4.6"]` to your `project.clj`. | |||
Add `[digest "1.4.7"]` to your `project.clj`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current version is 1.4.7, did you mean 1.4.8?
Also project.clj
and ChangeLog
need to be updated.
src/digest.clj
Outdated
size (.read reader buffer)] | ||
(when (pos? size) | ||
(if (= size *buffer-size*) buffer (Arrays/copyOf buffer size))))) | ||
(cond-> buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the same logic:
user=> (if true :buffer :new-buffer)
:buffer
user=> (if false :buffer :new-buffer)
:new-buffer
user=> (cond-> :buffer false :new-buffer)
:buffer
user=> (cond-> :buffer true :new-buffer)
nil
src/digest.clj
Outdated
(:import java.util.Arrays | ||
(java.security MessageDigest Security Provider) | ||
(java.io FileInputStream File InputStream))) | ||
(:require [clojure.string :refer [lower-case split] :as string]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why is
requite
better thanuse
? - We how using functions from string without the prefix (lower-case, split) and with the prefix (string/join). I prefer one consistent way
src/digest.clj
Outdated
(symbol (lower-case algorithm-name)) | ||
:doc (str "Encode the given message with the " algorithm-name " algorithm.") | ||
:arglists '([message])))] | ||
(-> 'digest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this better than the previous threading?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified threading in order to get rid of lein kibit
warning - will restore the original version.
src/digest.clj
Outdated
(doseq [algorithm (algorithms)] | ||
(create-fn! algorithm))) | ||
[] | ||
(run! create-fn! (algorithms))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is run!
better than doseq
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only difference between run!
and doseq
seems to be that run!
doesn't support bindings which makes the code a bit shorter. Will restore doseq
.
ee3ee86
to
67cf467
Compare
No description provided.