clippy fix

This commit is contained in:
OMGeeky
2024-06-04 20:31:31 +02:00
parent ed76e1bf20
commit 99e14672b9
3 changed files with 4 additions and 4 deletions

View File

@@ -248,7 +248,7 @@ async fn get_part_files(folder_path: &Path, count: i32) -> Result<Vec<(PathBuf,
parts.push((path, part_number));
}
if parts.len() != count as usize {
return Err(UploaderError::PartCountMismatch(count as usize, parts.len()).into());
return Err(UploaderError::PartCountMismatch(count as usize, parts.len()));
}
parts.sort_by_key(|a| a.1);
Ok(parts)
@@ -275,7 +275,7 @@ fn get_part_number_from_path(path: &Path) -> Result<usize> {
warn!("path has not the expected extension (.mp4): {:?}", path);
}
}
Err(UploaderError::WrongFileExtension.into())
Err(UploaderError::WrongFileExtension)
}
impl UploaderClient {

View File

@@ -56,7 +56,7 @@ impl YoutubeClient {
let video = Video {
snippet: Some(VideoSnippet {
title: Some(video_data.video_title),
description: Some(video_data.video_description.into()),
description: Some(video_data.video_description),
category_id: Some(video_data.video_category.to_string()),
tags: Some(video_data.video_tags),
..Default::default()

View File

@@ -85,7 +85,7 @@ pub(crate) fn create_youtube_title(
Location::Playlist => Some(YOUTUBE_TITLE_MAX_LENGTH),
Location::Other => None,
};
let title = shorten_string_if_needed(&title, max_len);
let title = shorten_string_if_needed(title, max_len);
Ok(title)
}