From c9ea93f0b415dc3ea8c86ec0f5c5862c7b593a00 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 22 Aug 2026 21:18:02 +0200 Subject: treewide: Fix most `cargo check` warnings The remaining ones, require actual work to resolve. --- crates/daemon/src/main.rs | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'crates/daemon/src') diff --git a/crates/daemon/src/main.rs b/crates/daemon/src/main.rs index 8fd3c119..d157d075 100644 --- a/crates/daemon/src/main.rs +++ b/crates/daemon/src/main.rs @@ -43,21 +43,6 @@ enum Cmd { #[tokio::main] async fn main() -> Result<()> { - if let Err(e) = tracing_subscriber::fmt() - .with_file(true) - .with_line_number(true) - .with_level(true) - .without_time() - .with_env_filter( - EnvFilter::builder() - .from_env_lossy() - .add_directive("turtle_daemon=debug".parse().unwrap()), - ) - .try_init() - { - eprintln!("failed to initialize logging: {e}"); - } - let settings = Settings::new().wrap_err("could not load client settings")?; if !settings.paths_ok() { bail!("Failed to verify all paths :("); @@ -70,7 +55,25 @@ async fn main() -> Result<()> { let sqlite_store = SqliteStore::new(record_store_path, settings.local_timeout).await?; match Cmd::parse() { - Cmd::Start { show_logs, .. } => boot(settings, sqlite_store, history_db).await, + Cmd::Start { show_logs, .. } => { + if show_logs + && let Err(e) = tracing_subscriber::fmt() + .with_file(true) + .with_line_number(true) + .with_level(true) + .without_time() + .with_env_filter( + EnvFilter::builder() + .from_env_lossy() + .add_directive("turtle_daemon=debug".parse().unwrap()), + ) + .try_init() + { + eprintln!("failed to initialize logging: {e}"); + } + + boot(settings, sqlite_store, history_db).await + } } } -- cgit v1.3.1