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 endpoints
.nonstandard .nonstandard
.values() .values()
.map(|v| check_opt(v, authority_opt.as_ref())) .try_for_each(|v| check_opt(v, authority_opt.as_ref()))?;
.collect::<Result<(), _>>()?;
return Ok(Some(endpoints)); 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 /// A list of units of length that represent valid units for certain ActivityStreams objects
#[derive( #[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)] #[serde(untagged)]
enum Length { enum Length {
@ -238,6 +247,7 @@ enum Length {
#[serde(rename = "km")] #[serde(rename = "km")]
Kilometers, Kilometers,
#[default]
#[serde(rename = "m")] #[serde(rename = "m")]
Meters, Meters,
} }
@ -276,12 +286,6 @@ impl Length {
} }
} }
impl Default for Length {
fn default() -> Self {
Length::Meters
}
}
impl std::str::FromStr for Length { impl std::str::FromStr for Length {
type Err = LengthError; type Err = LengthError;