diff options
author | Wojciech Kępka | 2021-06-06 05:34:18 +0000 |
---|---|---|
committer | Ivan Tham | 2021-06-06 09:28:09 +0000 |
commit | bcb1afeb4ca9d1764b2f1dba08f9772ac744c83a (patch) | |
tree | ee6558e36dc04ed31a05025fd857fa4b593e5dd3 /helix-view | |
parent | de946d2357e2cd4b64acbfc7bb45e3ead3785b83 (diff) |
Add a comment to `canonicalize_path`
Diffstat (limited to 'helix-view')
-rw-r--r-- | helix-view/src/document.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index f901e644..9093dbe8 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -104,6 +104,10 @@ pub fn normalize_path(path: &Path) -> PathBuf { ret } +// Returns the canonical, absolute form of a path with all intermediate components normalized. +// +// This function is used instead of `std::fs::canonicalize` because we don't want to verify +// here if the path exists, just normalize it's components. pub fn canonicalize_path(path: &Path) -> std::io::Result<PathBuf> { std::env::current_dir().map(|current_dir| normalize_path(¤t_dir.join(path))) } |