diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-25 17:30:02 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-25 17:30:02 +0200 |
commit | a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411 (patch) | |
tree | 24dc96e5384cf9309ae4ec00d6d91497e3253484 /src/storage/video_database/downloader.rs | |
parent | docs(yt_dlp/progress_hook): Add a note about the possibility to calculate vid... (diff) | |
download | yt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.tar.gz yt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.zip |
refactor(treewide): Conform to `cargo clippy`
Diffstat (limited to 'src/storage/video_database/downloader.rs')
-rw-r--r-- | src/storage/video_database/downloader.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/storage/video_database/downloader.rs b/src/storage/video_database/downloader.rs index bba2b0a..c5490f3 100644 --- a/src/storage/video_database/downloader.rs +++ b/src/storage/video_database/downloader.rs @@ -43,11 +43,7 @@ pub async fn get_next_uncached_video(app: &App) -> Result<Option<Video>> { } else { let base = result?; - let thumbnail_url = if let Some(url) = &base.thumbnail_url { - Some(Url::parse(&url).expect("Parsing this as url should always work")) - } else { - None - }; + let thumbnail_url = base.thumbnail_url.as_ref().map(|url| Url::parse(url).expect("Parsing this as url should always work")); let status_change = if base.status_change == 1 { true @@ -57,7 +53,7 @@ pub async fn get_next_uncached_video(app: &App) -> Result<Option<Video>> { }; let video = Video { - cache_path: base.cache_path.as_ref().map(|val| PathBuf::from(val)), + cache_path: base.cache_path.as_ref().map(PathBuf::from), description: base.description.clone(), duration: base.duration, extractor_hash: ExtractorHash::from_hash( |