chore: fix clippy lints

This commit is contained in:
ThetaDev 2024-01-18 13:23:56 +01:00
parent 71f7a0643a
commit e9fb16353a
4 changed files with 11 additions and 8 deletions

View file

@ -529,7 +529,7 @@ fn map_channel_content(
.content .content
.section_list_renderer .section_list_renderer
.as_ref() .as_ref()
.and_then(|c| c.contents.c.get(0)) .and_then(|c| c.contents.c.first())
{ {
return Err(ExtractionError::Unavailable { return Err(ExtractionError::Unavailable {
reason: crate::error::UnavailabilityReason::AgeRestricted, reason: crate::error::UnavailabilityReason::AgeRestricted,

View file

@ -327,7 +327,7 @@ impl MapResponse<MusicAlbum> for response::MusicPlaylist {
let year_txt = subtitle_split let year_txt = subtitle_split
.swap_remove(2) .swap_remove(2)
.0 .0
.get(0) .first()
.map(|c| c.as_str().to_owned()); .map(|c| c.as_str().to_owned());
(year_txt, subtitle_split.try_swap_remove(1)) (year_txt, subtitle_split.try_swap_remove(1))
} }

View file

@ -335,12 +335,14 @@ impl From<Thumbnails> for Vec<crate::model::Thumbnail> {
impl From<Vec<ChannelBadge>> for crate::model::Verification { impl From<Vec<ChannelBadge>> for crate::model::Verification {
fn from(badges: Vec<ChannelBadge>) -> Self { fn from(badges: Vec<ChannelBadge>) -> Self {
badges.get(0).map_or(crate::model::Verification::None, |b| { badges
match b.metadata_badge_renderer.style { .first()
ChannelBadgeStyle::BadgeStyleTypeVerified => Self::Verified, .map_or(crate::model::Verification::None, |b| {
ChannelBadgeStyle::BadgeStyleTypeVerifiedArtist => Self::Artist, match b.metadata_badge_renderer.style {
} ChannelBadgeStyle::BadgeStyleTypeVerified => Self::Verified,
}) ChannelBadgeStyle::BadgeStyleTypeVerifiedArtist => Self::Artist,
}
})
} }
} }

View file

@ -3,6 +3,7 @@
#![allow( #![allow(
clippy::doc_markdown, clippy::doc_markdown,
clippy::similar_names, clippy::similar_names,
clippy::struct_field_names,
clippy::items_after_statements, clippy::items_after_statements,
clippy::too_many_lines, clippy::too_many_lines,
clippy::module_name_repetitions, clippy::module_name_repetitions,