chore: fix clippy warnings

This commit is contained in:
Ashhhleyyy 2024-01-20 14:01:42 +00:00
parent a683398ea2
commit 342aa8541c
Signed by: ash
GPG key ID: 83B789081A0878FB
3 changed files with 11 additions and 19 deletions

View file

@ -33,17 +33,11 @@ pub enum ContentType {
impl ContentType {
pub fn is_season(&self) -> bool {
match self {
ContentType::Season => true,
_ => false,
}
matches!(self, ContentType::Season)
}
pub fn is_episode(&self) -> bool {
match self {
ContentType::Episode => true,
_ => false,
}
matches!(self, ContentType::Episode)
}
}
@ -176,7 +170,7 @@ impl SubtitleTrack {
".mp4",
&format!(".{}.{}", subtitle.language, subtitle.ext().unwrap()),
),
label: Self::label_from_lang(&subtitle.language).to_string(),
label: Self::label_from_lang(&subtitle.language),
lang: subtitle.language,
}
}

View file

@ -73,10 +73,10 @@ pub fn vidstack_player(
pub fn native_player(
title: &str,
video_url: &str,
aspect: &str,
poster: &str,
_aspect: &str,
_poster: &str,
subtitles: &[SubtitleTrack],
args: &Args,
_args: &Args,
) -> Result<maud::Markup> {
Ok(base_template(
title,
@ -129,14 +129,12 @@ pub fn tv_show(details: &ItemMeta, args: &Args, children: &[ItemMeta]) -> Result
.seasons {
@for child in children {
@if child.ty.is_season() {
@match season_card(&child.data, &child.url, args) {
Ok(s) => (s),
Err(_) => {},
@if let Ok(s) = season_card(&child.data, &child.url, args) {
(s)
}
} @else if child.ty.is_episode() {
@match episode_card(&child.data, &child.url, args) {
Ok(s) => (s),
Err(_) => {},
@if let Ok(e) = episode_card(&child.data, &child.url, args) {
(e)
}
}
}

View file

@ -167,7 +167,7 @@ fn load_contents(path: &Path, content_type: ContentType, args: &Args) -> Result<
ContentType::Episode => unreachable!(),
};
let data = read_data(&path.join(meta_file))?;
let url = get_url(&path.to_string_lossy().to_owned(), args)?;
let url = get_url(&path.to_string_lossy(), args)?;
let parent = match content_type {
ContentType::TvShow => None,
ContentType::Season => Some(read_data(&path.parent().unwrap().join("tvshow.nfo"))?),