1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-27 07:19:04 +02:00

chore: address clippy warnings

This commit is contained in:
Rob Ede
2024-12-29 15:03:43 +00:00
parent 472dbca64e
commit 34327bd221
10 changed files with 19 additions and 14 deletions

View File

@ -10,7 +10,7 @@ use bytes::BufMut;
/// perform a remaining length check before writing.
pub(crate) struct MutWriter<'a, B>(pub(crate) &'a mut B);
impl<'a, B> io::Write for MutWriter<'a, B>
impl<B> io::Write for MutWriter<'_, B>
where
B: BufMut,
{

View File

@ -704,7 +704,7 @@ impl FormatText {
/// Converter to get a String from something that writes to a Formatter.
pub(crate) struct FormatDisplay<'a>(&'a dyn Fn(&mut fmt::Formatter<'_>) -> Result<(), fmt::Error>);
impl<'a> fmt::Display for FormatDisplay<'a> {
impl fmt::Display for FormatDisplay<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
(self.0)(fmt)
}

View File

@ -332,7 +332,7 @@ impl<T: DeserializeOwned> JsonBody<T> {
(true, Ok(Some(mime))) => {
mime.subtype() == mime::JSON
|| mime.suffix() == Some(mime::JSON)
|| ctype_fn.map_or(false, |predicate| predicate(mime))
|| ctype_fn.is_some_and(|predicate| predicate(mime))
}
// if content-type is expected but not parsable as mime type, bail