fix: apply rustfmt formatting to git dates code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Test
2026-04-02 15:03:41 +02:00
parent e2d0a46608
commit fd642889c8
4 changed files with 9 additions and 13 deletions

View File

@@ -218,10 +218,7 @@ notes/daily.md
// So modified_at > created_at (or equal if commits are same second)
assert!(map["first.md"].modified_at >= map["first.md"].created_at);
// second.md: only in commit 2
assert_eq!(
map["second.md"].modified_at,
map["second.md"].created_at
);
assert_eq!(map["second.md"].modified_at, map["second.md"].created_at);
}
#[test]

View File

@@ -503,7 +503,8 @@ mod tests {
let vault_path = dir.path().join("parse-vault");
create_getting_started_vault(vault_path.to_str().unwrap()).unwrap();
let entries = crate::vault::scan_vault(&vault_path, &std::collections::HashMap::new()).unwrap();
let entries =
crate::vault::scan_vault(&vault_path, &std::collections::HashMap::new()).unwrap();
// SAMPLE_FILES + AGENTS.md
assert_eq!(entries.len(), SAMPLE_FILES.len() + 1);
}

View File

@@ -39,10 +39,7 @@ use walkdir::WalkDir;
/// If `git_dates` is provided, those timestamps override filesystem metadata
/// for `modified_at` and `created_at`. Pass `None` to use filesystem dates
/// (appropriate for newly-saved files not yet committed, or non-git vaults).
pub fn parse_md_file(
path: &Path,
git_dates: Option<(u64, u64)>,
) -> Result<VaultEntry, String> {
pub fn parse_md_file(path: &Path, git_dates: Option<(u64, u64)>) -> Result<VaultEntry, String> {
let content = fs::read_to_string(path)
.map_err(|e| format!("Failed to read {}: {}", path.display(), e))?;
let filename = path
@@ -154,9 +151,7 @@ fn lookup_git_dates(
.ok()?
.to_string_lossy()
.to_string();
git_dates
.get(&rel)
.map(|d| (d.modified_at, d.created_at))
git_dates.get(&rel).map(|d| (d.modified_at, d.created_at))
}
fn try_parse_md(

View File

@@ -196,7 +196,10 @@ fn test_scan_vault_skips_hidden_folders() {
#[test]
fn test_scan_vault_nonexistent_path() {
let result = scan_vault(Path::new("/nonexistent/path/that/does/not/exist"), &HashMap::new());
let result = scan_vault(
Path::new("/nonexistent/path/that/does/not/exist"),
&HashMap::new(),
);
assert!(result.is_err());
}