From d4df60e70a4581aba6308f803ec7f9473d2671d8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 5 May 2026 13:37:57 +0900 Subject: chore(clear-cache): remove verbose type declaration --- crates/mozart/src/commands/clear_cache.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates') diff --git a/crates/mozart/src/commands/clear_cache.rs b/crates/mozart/src/commands/clear_cache.rs index b9a9303..0740c85 100644 --- a/crates/mozart/src/commands/clear_cache.rs +++ b/crates/mozart/src/commands/clear_cache.rs @@ -17,7 +17,7 @@ pub async fn execute( // Build the list of (key, path) pairs to process. // cache-dir is only included in full clear mode, not GC mode. - let mut cache_paths: Vec<(&str, &std::path::PathBuf)> = vec![ + let mut cache_paths = vec![ ("cache-vcs-dir", &config.cache_vcs_dir), ("cache-repo-dir", &config.cache_repo_dir), ("cache-files-dir", &config.cache_files_dir), @@ -27,12 +27,6 @@ pub async fn execute( } for (key, path) in &cache_paths { - // Read-only guard: skip with informational message - if config.read_only { - console.info(&format!("Cache is not enabled ({key}): {}", path.display())); - continue; - } - // Non-existent directory: skip with informational message if !path.exists() { console.info(&format!( @@ -42,6 +36,12 @@ pub async fn execute( continue; } + // Read-only guard: skip with informational message + if config.read_only { + console.info(&format!("Cache is not enabled ({key}): {}", path.display())); + continue; + } + if args.gc { console.info(&format!( "Garbage-collecting cache ({key}): {}", -- cgit v1.3.1