diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-25 17:35:02 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-25 17:35:02 +0200 |
commit | e9be4219b63cbb4fdfe8de8779481568a69ceb8a (patch) | |
tree | d2568d4e482768c90c625a7a7ffd5a632811ba30 | |
parent | refactor(treewide): Conform to `cargo clippy` (diff) | |
download | yt-e9be4219b63cbb4fdfe8de8779481568a69ceb8a.tar.gz yt-e9be4219b63cbb4fdfe8de8779481568a69ceb8a.zip |
style(treewide): Reformat
Diffstat (limited to '')
-rw-r--r-- | crates/yt_dlp/src/logging.rs | 4 | ||||
-rw-r--r-- | src/select/cmds.rs | 4 | ||||
-rw-r--r-- | src/storage/video_database/downloader.rs | 5 | ||||
-rw-r--r-- | src/update/mod.rs | 3 | ||||
-rw-r--r-- | 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<i64>, priority: Option<i64>) -> Option<i64> { 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<Option<Video>> { } 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 |