refactor: split music item mapping into multiple fns

This commit is contained in:
ThetaDev 2023-07-22 16:36:20 +02:00
parent 1d94d0241b
commit 68926b9ca2
3 changed files with 423 additions and 436 deletions

View file

@ -297,7 +297,7 @@ impl<'de> DeserializeAs<'de, TextComponents> for AttributedText {
}
impl TryFrom<TextComponent> for crate::model::ChannelId {
type Error = util::MappingError;
type Error = ();
fn try_from(value: TextComponent) -> Result<Self, Self::Error> {
match value {
@ -310,9 +310,9 @@ impl TryFrom<TextComponent> for crate::model::ChannelId {
id: browse_id,
name: text,
}),
_ => Err(util::MappingError("invalid channel link type".into())),
_ => Err(()),
},
_ => Err(util::MappingError("invalid channel link".into())),
_ => Err(()),
}
}
}