aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-02-12 19:59:09 +0100
committerHarald Eilertsen <haraldei@anduin.net>2019-02-12 19:59:09 +0100
commit08183b0b57d40be95b67bcafad9fec94f83228d1 (patch)
tree870bbc4e7f1704b8eaa2cdd1984c32bc37a9112f
parente09189895bb4440c2c3434d5770f9f9a8bcd8f03 (diff)
downloadcheckpw-08183b0b57d40be95b67bcafad9fec94f83228d1.tar.gz
checkpw-08183b0b57d40be95b67bcafad9fec94f83228d1.tar.bz2
checkpw-08183b0b57d40be95b67bcafad9fec94f83228d1.zip
Set edition 2018 and fix clippy issues.
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs7
2 files changed, 3 insertions, 5 deletions
diff --git a/Cargo.toml b/Cargo.toml
index cf0ca66..22050f8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,6 +18,7 @@
name = "checkpw"
version = "0.1.0"
authors = ["Harald Eilertsen <haraldei@anduin.net>"]
+edition = "2018"
[dependencies]
reqwest = "0.9.5"
diff --git a/src/main.rs b/src/main.rs
index d2abe53..5dfb7b4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -24,7 +24,7 @@ use ring::digest;
// Convert a slice of bytes into a string of hex values
//
fn to_hex(data: &[u8]) -> String {
- data.into_iter()
+ data.iter()
.map(|b| format!("{:02X}", b))
.collect()
}
@@ -61,10 +61,7 @@ impl Password {
pub fn new(pw: &str) -> Password {
let (range, rest) = to_k_anon(digest::digest(&digest::SHA1, &pw.as_bytes()));
- Password {
- range: range,
- rest: rest,
- }
+ Password { range, rest, }
}
pub fn is_pwned(&self, hashes: &str) -> usize {