Skip to content

Commit

Permalink
fix(clippy): appease the paperclip
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Sep 16, 2021
1 parent 2c1b212 commit 0b1eb50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl IntegrityChecker {
.take_while(|h| h.algorithm == algo)
.find(|&h| *h == sri.hashes[0])
.map(|_| algo)
.ok_or_else(|| Error::IntegrityCheckError(wanted, sri))
.ok_or(Error::IntegrityCheckError(wanted, sri))
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ impl std::str::FromStr for Hash {
let mut parsed = s.trim().split(|c| c == '-');
let algorithm = parsed
.next()
.ok_or(Error::ParseIntegrityError(s.into()))?
.ok_or_else(|| Error::ParseIntegrityError(s.into()))?
.parse()?;
let digest = String::from(parsed.next().ok_or(Error::ParseIntegrityError(s.into()))?);
let digest = String::from(
parsed
.next()
.ok_or_else(|| Error::ParseIntegrityError(s.into()))?,
);
Ok(Hash { algorithm, digest })
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use crate::algorithm::Algorithm;
use crate::hash::Hash;
use crate::integrity::Integrity;

use base64;
use digest::Digest;
use sha1;
use sha2;

#[allow(clippy::enum_variant_names)]
#[derive(Clone)]
Expand Down

0 comments on commit 0b1eb50

Please sign in to comment.