Skip to content

Commit 663cf77

Browse files
committed
fix comment
1 parent eca7b0b commit 663cf77

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/fs.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ pub fn canonicalize_path_maybe_not_exists(
4646
// When the provided path is a relative path (e.g. `foo/bar.txt`),
4747
// `path.parent()` ends up being the empty string as documented in
4848
// `std::path::Path::parent()` after going up the ancestor path.
49-
// In this case, we return a path concatenating the current path with
50-
// the provided path i.e. `{cwd}/foo/bar.txt`.
49+
// In this case, what this function should return is a path joining
50+
// the current path with the provided path i.e. `{cwd}/foo/bar.txt`,
51+
// so we set `path` to `.` to indicate the current directory.
5152
Some(parent) if parent.as_os_str().is_empty() => Path::new("."),
5253
Some(parent) => parent,
5354
None => return Err(err),

0 commit comments

Comments
 (0)