Clippy nits

This commit is contained in:
asonix 2023-07-06 11:41:54 -05:00
parent b928f8e77f
commit 658f832d08
2 changed files with 12 additions and 9 deletions

View file

@ -866,8 +866,7 @@ pub trait ApActorExt: AsApActor {
endpoints
.nonstandard
.values()
.map(|v| check_opt(v, authority_opt.as_ref()))
.collect::<Result<(), _>>()?;
.try_for_each(|v| check_opt(v, authority_opt.as_ref()))?;
return Ok(Some(endpoints));
}

View file

@ -222,7 +222,16 @@ impl From<&str> for Unit {
/// A list of units of length that represent valid units for certain ActivityStreams objects
#[derive(
Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, serde::Deserialize, serde::Serialize,
Clone,
Debug,
Default,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
serde::Deserialize,
serde::Serialize,
)]
#[serde(untagged)]
enum Length {
@ -238,6 +247,7 @@ enum Length {
#[serde(rename = "km")]
Kilometers,
#[default]
#[serde(rename = "m")]
Meters,
}
@ -276,12 +286,6 @@ impl Length {
}
}
impl Default for Length {
fn default() -> Self {
Length::Meters
}
}
impl std::str::FromStr for Length {
type Err = LengthError;