From 45d11a8bde6cbd853b75e05f2b3fb718593ee8ea Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 26 May 2026 18:30:03 +0200 Subject: style(yt/config): Format --- crates/yt/src/config/mod.rs | 12 +++++++++--- crates/yt/src/storage/db/insert/playlist.rs | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/yt/src/config/mod.rs b/crates/yt/src/config/mod.rs index 24866eb..6e596de 100644 --- a/crates/yt/src/config/mod.rs +++ b/crates/yt/src/config/mod.rs @@ -48,7 +48,8 @@ mk_config! { struct Config { global: GlobalConfig = { /// Whether to display colors. - display_colors: bool where display_color: Option =! {|config_value: Option| + display_colors: bool where display_color: Option =! { + |config_value: Option| Ok::<_, anyhow::Error>( display_color .unwrap_or( @@ -121,8 +122,13 @@ mk_config! { mpv_ipc_socket_path: PathBuf =? get_runtime_path("mpv.ipc.socket") => ensure_parent_dir, /// Path to the video database. - database_path: PathBuf where db_path: Option =! {|config_value: Option| { - db_path.map_or_else(|| config_value.map_or_else(|| get_data_path("videos.sqlite"), Ok), Ok) + database_path: PathBuf where db_path: Option =! { + |config_value: Option| { + db_path + .map_or_else( + || config_value.map_or_else(|| get_data_path("videos.sqlite"), Ok), + Ok + ) }} => ensure_parent_dir, /// Where to store the selection file before applying it. diff --git a/crates/yt/src/storage/db/insert/playlist.rs b/crates/yt/src/storage/db/insert/playlist.rs index 4d3e140..26d5376 100644 --- a/crates/yt/src/storage/db/insert/playlist.rs +++ b/crates/yt/src/storage/db/insert/playlist.rs @@ -40,7 +40,7 @@ impl Playlist { ) -> Result<()> { let (current_index, current_video) = self .get_focused_mut() - .expect("This should be some at this point"); + .expect("This should be some at this point"); // TODO: This expectation doesn't hold, if the video is marked as dropped before it is `quit`ed in the `yt watch` <2026-05-13> debug!( "Playlist handler will mark video '{}' {:?}.", -- cgit v1.3.1