clippy fix
This commit is contained in:
parent
52d455e219
commit
6ba17d57df
4 changed files with 8 additions and 7 deletions
|
|
@ -121,15 +121,16 @@ impl Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_mismatch<E, A>(&self, has_expected: E, has_actual: A) -> bool
|
pub fn is_mismatch<E, A>(&self, want_expected: E, want_actual: A) -> bool
|
||||||
where
|
where
|
||||||
String: PartialEq<E> + PartialEq<A>,
|
E: AsRef<str>,
|
||||||
|
A: AsRef<str>,
|
||||||
{
|
{
|
||||||
matches!(
|
matches!(
|
||||||
self,
|
self,
|
||||||
Self::Mismatch { expected, actual }
|
Self::Mismatch { expected, actual }
|
||||||
if *expected == has_expected
|
if expected == want_expected.as_ref()
|
||||||
&& *actual == has_actual
|
&& actual == want_actual.as_ref()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ impl FileTrait for Checked {
|
||||||
super::check_hash(
|
super::check_hash(
|
||||||
&self.path,
|
&self.path,
|
||||||
self.size,
|
self.size,
|
||||||
self.hash.as_ref().map(String::as_str),
|
self.hash.as_deref(),
|
||||||
on_progress,
|
on_progress,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ pub use uploading::Uploading;
|
||||||
const HASH_CHUNK_SIZE: usize = 4 * 1024 * 1024;
|
const HASH_CHUNK_SIZE: usize = 4 * 1024 * 1024;
|
||||||
|
|
||||||
/// compute hash for a file given its path.
|
/// compute hash for a file given its path.
|
||||||
/// Hash function: BLAKE2b, 512 bit
|
/// Hash function: `BLAKE2b`, 512 bit
|
||||||
///
|
///
|
||||||
/// # Params
|
/// # Params
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ impl FileTrait for Uploading {
|
||||||
super::check_hash(
|
super::check_hash(
|
||||||
&self.path,
|
&self.path,
|
||||||
self.size,
|
self.size,
|
||||||
self.hash.as_ref().map(String::as_str),
|
self.hash.as_deref(),
|
||||||
on_progress,
|
on_progress,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue