From e29360ef0a8574aabfbaead6921722ff96d7e267 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Sat, 7 Mar 2026 12:46:43 +0100 Subject: [PATCH] style: cargo fmt config_seed.rs and getting_started.rs Co-Authored-By: Claude Opus 4.6 --- src-tauri/src/vault/config_seed.rs | 10 ++++------ src-tauri/src/vault/getting_started.rs | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src-tauri/src/vault/config_seed.rs b/src-tauri/src/vault/config_seed.rs index 92208074..d6e2fcfb 100644 --- a/src-tauri/src/vault/config_seed.rs +++ b/src-tauri/src/vault/config_seed.rs @@ -117,8 +117,8 @@ pub fn repair_config_files(vault_path: &str) -> Result { let root_content = fs::read_to_string(&root_agents).unwrap_or_default(); let is_stub = root_content.contains("See config/agents.md"); if !is_stub && !root_content.is_empty() { - let config_needs_write = !agents_path.exists() - || fs::metadata(&agents_path).map_or(true, |m| m.len() == 0); + let config_needs_write = + !agents_path.exists() || fs::metadata(&agents_path).map_or(true, |m| m.len() == 0); if config_needs_write { fs::write(&agents_path, &root_content) .map_err(|e| format!("Failed to migrate AGENTS.md: {e}"))?; @@ -138,8 +138,7 @@ pub fn repair_config_files(vault_path: &str) -> Result { // Step 3: Ensure type/config.md let type_dir = vault.join("type"); - fs::create_dir_all(&type_dir) - .map_err(|e| format!("Failed to create type directory: {e}"))?; + fs::create_dir_all(&type_dir).map_err(|e| format!("Failed to create type directory: {e}"))?; let config_type_path = type_dir.join("config.md"); let type_needs_write = !config_type_path.exists() || fs::metadata(&config_type_path).map_or(true, |m| m.len() == 0); @@ -150,8 +149,7 @@ pub fn repair_config_files(vault_path: &str) -> Result { // Step 4: Ensure root AGENTS.md stub exists let stub_needs_write = !root_agents.exists() - || fs::read_to_string(&root_agents) - .map_or(true, |c| !c.contains("See config/agents.md")); + || fs::read_to_string(&root_agents).map_or(true, |c| !c.contains("See config/agents.md")); if stub_needs_write { fs::write(&root_agents, AGENTS_MD_STUB) .map_err(|e| format!("Failed to write AGENTS.md stub: {e}"))?; diff --git a/src-tauri/src/vault/getting_started.rs b/src-tauri/src/vault/getting_started.rs index f37705d3..a30ac982 100644 --- a/src-tauri/src/vault/getting_started.rs +++ b/src-tauri/src/vault/getting_started.rs @@ -597,8 +597,7 @@ mod tests { let vault_path = dir.path().join("agents-parse-vault"); create_getting_started_vault(vault_path.to_str().unwrap()).unwrap(); - let entry = - crate::vault::parse_md_file(&vault_path.join("config/agents.md")).unwrap(); + let entry = crate::vault::parse_md_file(&vault_path.join("config/agents.md")).unwrap(); assert_eq!( entry.title, "AGENTS.md \u{2014} Vault Instructions for AI Agents"