From e9be4219b63cbb4fdfe8de8779481568a69ceb8a Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 25 Aug 2024 17:35:02 +0200 Subject: style(treewide): Reformat --- crates/yt_dlp/src/logging.rs | 4 +--- src/select/cmds.rs | 4 +++- src/storage/video_database/downloader.rs | 5 ++++- src/update/mod.rs | 3 ++- src/watch/events/mod.rs | 6 +----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/yt_dlp/src/logging.rs b/crates/yt_dlp/src/logging.rs index 02af3ff..4039da4 100644 --- a/crates/yt_dlp/src/logging.rs +++ b/crates/yt_dlp/src/logging.rs @@ -41,9 +41,7 @@ fn host_log(record: Bound<'_, PyAny>, rust_target: &str) -> PyResult<()> { Some(format!("{rust_target}::{logger_name}")) }; - let target = full_target - .as_deref() - .unwrap_or(rust_target); + let target = full_target.as_deref().unwrap_or(rust_target); // error let error_metadata = if level.ge(40u8)? { diff --git a/src/select/cmds.rs b/src/select/cmds.rs index 31589f2..3a7a800 100644 --- a/src/select/cmds.rs +++ b/src/select/cmds.rs @@ -81,5 +81,7 @@ async fn handle_status_change( fn compute_priority(line_number: Option, priority: Option) -> Option { if let Some(pri) = priority { Some(pri) - } else { line_number } + } else { + line_number + } } diff --git a/src/storage/video_database/downloader.rs b/src/storage/video_database/downloader.rs index c5490f3..ccd4ca9 100644 --- a/src/storage/video_database/downloader.rs +++ b/src/storage/video_database/downloader.rs @@ -43,7 +43,10 @@ pub async fn get_next_uncached_video(app: &App) -> Result> { } else { let base = result?; - let thumbnail_url = base.thumbnail_url.as_ref().map(|url| Url::parse(url).expect("Parsing this as url should always work")); + 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 diff --git a/src/update/mod.rs b/src/update/mod.rs index 69551ed..ce0a7e5 100644 --- a/src/update/mod.rs +++ b/src/update/mod.rs @@ -181,7 +181,8 @@ async fn process_subscription( // TODO: The algorithm is not exactly the best <2024-05-28> (Some(thumbnails), None) => Some( - thumbnails.first() + thumbnails + .first() .expect("At least one should exist") .url .clone(), diff --git a/src/watch/events/mod.rs b/src/watch/events/mod.rs index 1459147..41a7772 100644 --- a/src/watch/events/mod.rs +++ b/src/watch/events/mod.rs @@ -69,11 +69,7 @@ impl MpvEventHandler { let current_playlist = self.playlist_handler.playlist_ids(mpv)?; let play_things = play_things .into_iter() - .filter(|val| { - !current_playlist - .values() - .any(|a| a == &val.extractor_hash) - }) + .filter(|val| !current_playlist.values().any(|a| a == &val.extractor_hash)) .filter(|val| { if self .watch_later_block_list -- cgit 1.4.1