From e40c4612d6340d39dd12df8bb87f7a446b00a3c9 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Tue, 24 Feb 2026 23:10:46 +0100 Subject: [PATCH] fix: apply rustfmt formatting --- src-tauri/src/frontmatter.rs | 20 ++++++++++++++++---- src-tauri/src/vault/rename.rs | 5 ++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/frontmatter.rs b/src-tauri/src/frontmatter.rs index 4073d0ad..ae88284b 100644 --- a/src-tauri/src/frontmatter.rs +++ b/src-tauri/src/frontmatter.rs @@ -651,7 +651,10 @@ mod tests { fn test_split_frontmatter_empty_block() { // ---\n---\n (no fields between opening and closing ---) let result = split_frontmatter("---\n---\n"); - assert!(result.is_ok(), "split_frontmatter should handle empty frontmatter block"); + assert!( + result.is_ok(), + "split_frontmatter should handle empty frontmatter block" + ); let (fm, rest) = result.unwrap(); assert_eq!(fm, ""); assert_eq!(rest, "\n"); @@ -661,14 +664,20 @@ mod tests { fn test_split_frontmatter_empty_block_no_trailing_newline() { // ---\n--- (no trailing newline) let result = split_frontmatter("---\n---"); - assert!(result.is_ok(), "split_frontmatter should handle empty frontmatter without trailing newline"); + assert!( + result.is_ok(), + "split_frontmatter should handle empty frontmatter without trailing newline" + ); } #[test] fn test_split_frontmatter_empty_block_with_body() { // ---\n---\n\n# Title\n let result = split_frontmatter("---\n---\n\n# Title\n"); - assert!(result.is_ok(), "split_frontmatter should handle empty frontmatter with body"); + assert!( + result.is_ok(), + "split_frontmatter should handle empty frontmatter with body" + ); let (fm, rest) = result.unwrap(); assert_eq!(fm, ""); assert!(rest.contains("# Title")); @@ -682,7 +691,10 @@ mod tests { "title", Some(FrontmatterValue::String("New Title".to_string())), ); - assert!(result.is_ok(), "update_frontmatter_content should handle empty frontmatter block"); + assert!( + result.is_ok(), + "update_frontmatter_content should handle empty frontmatter block" + ); let updated = result.unwrap(); assert!(updated.contains("title: New Title")); } diff --git a/src-tauri/src/vault/rename.rs b/src-tauri/src/vault/rename.rs index ce301998..6299f179 100644 --- a/src-tauri/src/vault/rename.rs +++ b/src-tauri/src/vault/rename.rs @@ -427,7 +427,10 @@ mod tests { expected_slug ); assert!(!old_path.exists(), "old file should be removed"); - assert!(Path::new(&result.new_path).exists(), "new file should exist"); + assert!( + Path::new(&result.new_path).exists(), + "new file should exist" + ); fs::read_to_string(&result.new_path).unwrap() }