diff --git a/crates/k-launcher-os-bridge/src/unix_launcher.rs b/crates/k-launcher-os-bridge/src/unix_launcher.rs index 8561e97..375a03d 100644 --- a/crates/k-launcher-os-bridge/src/unix_launcher.rs +++ b/crates/k-launcher-os-bridge/src/unix_launcher.rs @@ -167,10 +167,7 @@ mod tests { #[test] fn split_quoted_path() { - assert_eq!( - shell_split(r#""My App" --flag"#), - vec!["My App", "--flag"] - ); + assert_eq!(shell_split(r#""My App" --flag"#), vec!["My App", "--flag"]); } #[test] diff --git a/crates/k-launcher-plugin-host/src/lib.rs b/crates/k-launcher-plugin-host/src/lib.rs index 0903385..f921562 100644 --- a/crates/k-launcher-plugin-host/src/lib.rs +++ b/crates/k-launcher-plugin-host/src/lib.rs @@ -105,15 +105,14 @@ impl Plugin for ExternalPlugin { } let result = match guard.as_mut() { - Some(io) => tokio::time::timeout( - std::time::Duration::from_secs(5), - do_search(io, query), - ) - .await - .unwrap_or_else(|_| { - tracing::warn!("plugin {} search timed out", self.name); - Err("timeout".into()) - }), + Some(io) => { + tokio::time::timeout(std::time::Duration::from_secs(5), do_search(io, query)) + .await + .unwrap_or_else(|_| { + tracing::warn!("plugin {} search timed out", self.name); + Err("timeout".into()) + }) + } None => unreachable!(), }; diff --git a/crates/plugins/plugin-apps/src/frecency.rs b/crates/plugins/plugin-apps/src/frecency.rs index 4f408b2..6870364 100644 --- a/crates/plugins/plugin-apps/src/frecency.rs +++ b/crates/plugins/plugin-apps/src/frecency.rs @@ -57,7 +57,10 @@ impl FrecencyStore { .as_secs(); let json = { let mut data = self.data.lock().unwrap(); - let entry = data.entry(id.to_string()).or_insert(Entry { count: 0, last_used: 0 }); + let entry = data.entry(id.to_string()).or_insert(Entry { + count: 0, + last_used: 0, + }); entry.count += 1; entry.last_used = now; serde_json::to_string(&*data).ok() diff --git a/crates/plugins/plugin-apps/src/lib.rs b/crates/plugins/plugin-apps/src/lib.rs index 2eec165..36a921f 100644 --- a/crates/plugins/plugin-apps/src/lib.rs +++ b/crates/plugins/plugin-apps/src/lib.rs @@ -135,7 +135,10 @@ fn save_to_path(path: &Path, entries: &HashMap) { } } -fn build_entries(source: &impl DesktopEntrySource, _frecency: &Arc) -> HashMap { +fn build_entries( + source: &impl DesktopEntrySource, + _frecency: &Arc, +) -> HashMap { source .entries() .into_iter() @@ -209,7 +212,10 @@ impl AppsPlugin { } #[cfg(test)] - fn new_for_test(source: impl DesktopEntrySource + 'static, frecency: Arc) -> Self { + fn new_for_test( + source: impl DesktopEntrySource + 'static, + frecency: Arc, + ) -> Self { Self::new_impl(source, frecency, None) } } @@ -498,8 +504,8 @@ mod tests { #[test] fn apps_loads_from_cache_when_source_is_empty() { let frecency = ephemeral_frecency(); - let cache_file = std::env::temp_dir() - .join(format!("k-launcher-test-{}.bin", std::process::id())); + let cache_file = + std::env::temp_dir().join(format!("k-launcher-test-{}.bin", std::process::id())); // Build entries from a real source and save to temp path let source = MockSource::with(vec![("Firefox", "firefox")]);