style: format search title lookup

This commit is contained in:
Test
2026-04-08 19:52:01 +02:00
parent 61309fef4b
commit 2c910779bf

View File

@@ -88,7 +88,10 @@ pub fn search_vault(
};
let content_lower = content.to_lowercase();
let filename = path.file_name().and_then(|value| value.to_str()).unwrap_or("");
let filename = path
.file_name()
.and_then(|value| value.to_str())
.unwrap_or("");
let title = crate::vault::derive_markdown_title_from_content(&content, filename);
let title_lower = title.to_lowercase();
@@ -179,7 +182,8 @@ mod tests {
)
.unwrap();
let response = search_vault(dir.path().to_str().unwrap(), "keyword", "keyword", 10).unwrap();
let response =
search_vault(dir.path().to_str().unwrap(), "keyword", "keyword", 10).unwrap();
assert_eq!(response.results.len(), 1);
assert_eq!(response.results[0].title, "Updated Display Title");