diff options
author | khai96_ <hvksmr1996@gmail.com> | 2019-05-01 07:33:12 +0000 |
---|---|---|
committer | khai96_ <hvksmr1996@gmail.com> | 2019-05-01 07:33:12 +0000 |
commit | 9c7c5bcb02536cabd88db8c77c984098c82e9cd5 (patch) | |
tree | e22f637909ae2c2926f74d67d6c16e6e19c537fd /src | |
parent | Ignore clippy warnings (diff) | |
download | miniserve-9c7c5bcb02536cabd88db8c77c984098c82e9cd5.tar.gz miniserve-9c7c5bcb02536cabd88db8c77c984098c82e9cd5.zip |
Fix some Clippy lints
Diffstat (limited to '')
-rw-r--r-- | src/auth.rs | 5 | ||||
-rw-r--r-- | src/main.rs | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/auth.rs b/src/auth.rs index 040e81f..e526923 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -75,9 +75,8 @@ pub fn match_auth(basic_auth: BasicAuthParams, required_auth: &RequiredAuth) -> } /// Return `true` if hashing of `password` by `T` algorithm equals to `hash` -#[allow(clippy::ptr_arg)] -pub fn compare_hash<T: Digest>(password: String, hash: &Vec<u8>) -> bool { - get_hash::<T>(password) == *hash +pub fn compare_hash<T: Digest>(password: String, hash: &[u8]) -> bool { + get_hash::<T>(password) == hash } /// Get hash of a `text` diff --git a/src/main.rs b/src/main.rs index b7563eb..ea58fc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,6 @@ fn main() { } } -#[allow(clippy::block_in_if_condition_stmt)] fn run() -> Result<(), ContextualError> { if cfg!(windows) && !Paint::enable_windows_ascii() { Paint::disable(); @@ -84,12 +83,12 @@ fn run() -> Result<(), ContextualError> { && miniserve_config .path .symlink_metadata() - .map_err(|e| { + .map_err(|e| ContextualError::IOError( "Failed to retrieve symlink's metadata".to_string(), e, ) - })? + )? .file_type() .is_symlink() { |