aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-vfs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-07-18 04:28:07 +0300
committerValentin Popov <valentin@popov.link>2026-07-18 04:28:07 +0300
commit2da28d0495e75a0954c194e2e0c4db03c23cb05f (patch)
tree2aa909ea4c197b5265064ef3974bce00fc5fc4c9 /crates/fparkan-vfs
parent02b4da2e3d78cc7df7278d7b17cf65620d58db54 (diff)
downloadfparkan-2da28d0495e75a0954c194e2e0c4db03c23cb05f.tar.xz
fparkan-2da28d0495e75a0954c194e2e0c4db03c23cb05f.zip
style: format workspace with Rust 1.97
Diffstat (limited to 'crates/fparkan-vfs')
-rw-r--r--crates/fparkan-vfs/src/lib.rs32
1 files changed, 14 insertions, 18 deletions
diff --git a/crates/fparkan-vfs/src/lib.rs b/crates/fparkan-vfs/src/lib.rs
index 7adddf0..4557884 100644
--- a/crates/fparkan-vfs/src/lib.rs
+++ b/crates/fparkan-vfs/src/lib.rs
@@ -257,11 +257,7 @@ fn select_casefolded_match(
}
}
-fn list_recursive(
- root: &Path,
- dir: &Path,
- out: &mut Vec<VfsEntry>,
-) -> Result<(), VfsError> {
+fn list_recursive(root: &Path, dir: &Path, out: &mut Vec<VfsEntry>) -> Result<(), VfsError> {
let read_dir = fs::read_dir(dir).map_err(VfsError::Io)?;
let mut children = Vec::new();
for entry in read_dir {
@@ -286,11 +282,9 @@ fn list_recursive(
let rel_bytes = rel.as_os_str().as_bytes();
#[cfg(not(unix))]
let rel_bytes = rel.to_str().ok_or(VfsError::Path)?.as_bytes();
- let path = fparkan_path::normalize_relative(
- rel_bytes,
- fparkan_path::PathPolicy::HostCompatible,
- )
- .map_err(|_| VfsError::Path)?;
+ let path =
+ fparkan_path::normalize_relative(rel_bytes, fparkan_path::PathPolicy::HostCompatible)
+ .map_err(|_| VfsError::Path)?;
out.push(VfsEntry {
path,
metadata: metadata_from_host_file(&child, &metadata)?,
@@ -299,10 +293,7 @@ fn list_recursive(
Ok(())
}
-fn metadata_from_host_file(
- path: &Path,
- metadata: &fs::Metadata,
-) -> Result<VfsMetadata, VfsError> {
+fn metadata_from_host_file(path: &Path, metadata: &fs::Metadata) -> Result<VfsMetadata, VfsError> {
if !metadata.is_file() {
return Err(VfsError::Path);
}
@@ -659,8 +650,7 @@ mod tests {
}
let vfs = DirectoryVfs::new(&root);
- let path =
- normalize_relative(b"data/\xFF.bin", PathPolicy::HostCompatible).expect("path");
+ let path = normalize_relative(b"data/\xFF.bin", PathPolicy::HostCompatible).expect("path");
assert_eq!(vfs.read(&path).expect("read raw path").as_ref(), b"raw");
let entries = vfs
@@ -770,8 +760,14 @@ mod tests {
let entries = overlay.list(&prefix).expect("list");
assert_eq!(entries.len(), 2);
- assert_eq!(entries[0].path.display_lossy(), entries[1].path.display_lossy());
- assert_ne!(entries[0].path.identity_bytes(), entries[1].path.identity_bytes());
+ assert_eq!(
+ entries[0].path.display_lossy(),
+ entries[1].path.display_lossy()
+ );
+ assert_ne!(
+ entries[0].path.identity_bytes(),
+ entries[1].path.identity_bytes()
+ );
}
fn unique_test_dir(name: &str) -> PathBuf {