Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Dec 26, 2024
1 parent fe24177 commit 79ba3cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 89 deletions.
86 changes: 1 addition & 85 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ url = "2.5.1"

[dev-dependencies]
pretty_assertions = "1.4.0"
sys_traits = { version = "0.1.0-alpha.4", features = ["memory"] }
sys_traits = { version = "0.1.0-alpha.5", features = ["memory"] }

[patch.crates-io]
sys_traits = { path = "../sys_traits" }
6 changes: 3 additions & 3 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use crate::normalize_path;
/// Note: When using this, you should be aware that a symlink may
/// subsequently be created along this path by some other code.
pub fn canonicalize_path_maybe_not_exists(
path: &Path,
sys: &impl FsCanonicalize,
path: &Path,
) -> std::io::Result<PathBuf> {
let path = normalize_path(path);
let mut path = path.as_path();
Expand Down Expand Up @@ -179,10 +179,10 @@ mod test {
sys.fs_create_dir_all("/a/b/c").unwrap();
sys.env_set_current_dir("/a/b").unwrap();
let path =
canonicalize_path_maybe_not_exists(&PathBuf::from("./c"), &sys).unwrap();
canonicalize_path_maybe_not_exists(&sys, &PathBuf::from("./c")).unwrap();
assert_eq!(path, PathBuf::from("/a/b/c"));
let path =
canonicalize_path_maybe_not_exists(&PathBuf::from("./c/d/e"), &sys)
canonicalize_path_maybe_not_exists(&sys, &PathBuf::from("./c/d/e"))
.unwrap();
assert_eq!(path, PathBuf::from("/a/b/c/d/e"));
}
Expand Down

0 comments on commit 79ba3cf

Please sign in to comment.