chore: fix clippy lints
This commit is contained in:
parent
11fe9a5fa1
commit
9ecf7eff74
4 changed files with 11 additions and 8 deletions
|
|
@ -529,7 +529,7 @@ fn map_channel_content(
|
|||
.content
|
||||
.section_list_renderer
|
||||
.as_ref()
|
||||
.and_then(|c| c.contents.c.get(0))
|
||||
.and_then(|c| c.contents.c.first())
|
||||
{
|
||||
return Err(ExtractionError::Unavailable {
|
||||
reason: crate::error::UnavailabilityReason::AgeRestricted,
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ impl MapResponse<MusicAlbum> for response::MusicPlaylist {
|
|||
let year_txt = subtitle_split
|
||||
.swap_remove(2)
|
||||
.0
|
||||
.get(0)
|
||||
.first()
|
||||
.map(|c| c.as_str().to_owned());
|
||||
(year_txt, subtitle_split.try_swap_remove(1))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -335,12 +335,14 @@ impl From<Thumbnails> for Vec<crate::model::Thumbnail> {
|
|||
|
||||
impl From<Vec<ChannelBadge>> for crate::model::Verification {
|
||||
fn from(badges: Vec<ChannelBadge>) -> Self {
|
||||
badges.get(0).map_or(crate::model::Verification::None, |b| {
|
||||
match b.metadata_badge_renderer.style {
|
||||
ChannelBadgeStyle::BadgeStyleTypeVerified => Self::Verified,
|
||||
ChannelBadgeStyle::BadgeStyleTypeVerifiedArtist => Self::Artist,
|
||||
}
|
||||
})
|
||||
badges
|
||||
.first()
|
||||
.map_or(crate::model::Verification::None, |b| {
|
||||
match b.metadata_badge_renderer.style {
|
||||
ChannelBadgeStyle::BadgeStyleTypeVerified => Self::Verified,
|
||||
ChannelBadgeStyle::BadgeStyleTypeVerifiedArtist => Self::Artist,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#![allow(
|
||||
clippy::doc_markdown,
|
||||
clippy::similar_names,
|
||||
clippy::struct_field_names,
|
||||
clippy::items_after_statements,
|
||||
clippy::too_many_lines,
|
||||
clippy::module_name_repetitions,
|
||||
|
|
|
|||
Reference in a new issue