diff --git a/src-tauri/src/vault/cache.rs b/src-tauri/src/vault/cache.rs index 1add13ce..55f85ef7 100644 --- a/src-tauri/src/vault/cache.rs +++ b/src-tauri/src/vault/cache.rs @@ -676,7 +676,11 @@ mod tests { let (_lock, _cache_tmp, dir) = setup_git_vault(); let vault = dir.path(); - create_test_file(vault, "existing.md", "---\ntitle: Existing\n---\n# Existing\n"); + create_test_file( + vault, + "existing.md", + "---\ntitle: Existing\n---\n# Existing\n", + ); git_add_commit(vault, "init"); // Prime cache diff --git a/src-tauri/src/vault/parsing.rs b/src-tauri/src/vault/parsing.rs index a56606d0..4f38fffd 100644 --- a/src-tauri/src/vault/parsing.rs +++ b/src-tauri/src/vault/parsing.rs @@ -326,10 +326,7 @@ mod tests { #[test] fn test_extract_title_fallback_to_filename() { - assert_eq!( - extract_title(None, "fallback-title.md"), - "Fallback Title" - ); + assert_eq!(extract_title(None, "fallback-title.md"), "Fallback Title"); } #[test] diff --git a/src-tauri/src/vault/title_sync.rs b/src-tauri/src/vault/title_sync.rs index 75e7d2ea..91c221c5 100644 --- a/src-tauri/src/vault/title_sync.rs +++ b/src-tauri/src/vault/title_sync.rs @@ -42,8 +42,8 @@ fn extract_raw_title(content: &str) -> Option { /// - If `title` is present but its slug doesn't match the filename stem → overwrite /// - If both are in sync → no-op pub fn sync_title_on_open(path: &Path) -> Result { - let content = - fs::read_to_string(path).map_err(|e| format!("Failed to read {}: {}", path.display(), e))?; + let content = fs::read_to_string(path) + .map_err(|e| format!("Failed to read {}: {}", path.display(), e))?; let filename = path .file_name() .map(|f| f.to_string_lossy().to_string()) @@ -136,7 +136,11 @@ mod tests { #[test] fn test_sync_adds_frontmatter_when_none_exists() { let dir = TempDir::new().unwrap(); - let path = write_note(dir.path(), "plain-note.md", "# Plain Note\n\nSome content.\n"); + let path = write_note( + dir.path(), + "plain-note.md", + "# Plain Note\n\nSome content.\n", + ); let result = sync_title_on_open(&path).unwrap(); assert_eq!( result,