xmpp-parsers: Fix most of the clippy warnings

Only the non-looping loop is kept for now, until we find a better
solution.
This commit is contained in:
Emmanuel Gil Peyrot 2024-07-03 11:06:33 +02:00
commit 69f480e709
8 changed files with 29 additions and 33 deletions

View file

@ -42,7 +42,7 @@ impl FromStr for Show {
"dnd" => Show::Dnd,
"xa" => Show::Xa,
_ => return Err(Error::Other("Invalid value for show.").into()),
_ => return Err(Error::Other("Invalid value for show.")),
})
}
}
@ -65,7 +65,7 @@ type Status = String;
type Priority = i8;
///
/// Accepted values for the 'type' attribute of a presence.
#[derive(Debug, Default, Clone, PartialEq)]
pub enum Type {
/// This value is not an acceptable 'type' attribute, it is only used
@ -114,7 +114,9 @@ impl FromStr for Type {
"unsubscribed" => Type::Unsubscribed,
_ => {
return Err(Error::Other("Invalid 'type' attribute on presence element.").into());
return Err(Error::Other(
"Invalid 'type' attribute on presence element.",
));
}
})
}