@@ -40,7 +40,6 @@ pub fn expand_tilde(path: &Path) -> PathBuf {
40/// needs to improve on.
40/// needs to improve on.
41/// Copied from cargo: <https://github.com/rust-lang/cargo/blob/070e459c2d8b79c5b2ac5218064e7603329c92ae/crates/cargo-util/src/paths.rs#L81>
41/// Copied from cargo: <https://github.com/rust-lang/cargo/blob/070e459c2d8b79c5b2ac5218064e7603329c92ae/crates/cargo-util/src/paths.rs#L81>
42pub fn get_normalized_path(path: &Path) -> PathBuf {
42pub fn get_normalized_path(path: &Path) -> PathBuf {
43− let path = expand_tilde(path);
44 let mut components = path.components().peekable();
43 let mut components = path.components().peekable();
45 let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
44 let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
46 components.next();
45 components.next();
@@ -72,10 +71,11 @@ pub fn get_normalized_path(path: &Path) -> PathBuf {
72/// This function is used instead of `std::fs::canonicalize` because we don't want to verify
71/// This function is used instead of `std::fs::canonicalize` because we don't want to verify
73/// here if the path exists, just normalize it's components.
72/// here if the path exists, just normalize it's components.
74pub fn get_canonicalized_path(path: &Path) -> std::io::Result<PathBuf> {
73pub fn get_canonicalized_path(path: &Path) -> std::io::Result<PathBuf> {
74+ let path = expand_tilde(path);
75 let path = if path.is_relative() {
75 let path = if path.is_relative() {
76 std::env::current_dir().map(|current_dir| current_dir.join(path))?
76 std::env::current_dir().map(|current_dir| current_dir.join(path))?
78− path.to_path_buf()
78+ path
81 Ok(get_normalized_path(path.as_path()))
81 Ok(get_normalized_path(path.as_path()))