Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iho committed Oct 11, 2023
1 parent 06dbb8d commit ad0708a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cargo-near/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ pub(crate) fn compile_project(
/// Create the directory if it doesn't exist, and return the absolute path to it.
pub(crate) fn force_canonicalize_dir(dir: &Utf8Path) -> color_eyre::eyre::Result<Utf8PathBuf> {
fs::create_dir_all(dir).wrap_err_with(|| format!("failed to create directory `{}`", dir))?;
// use `dunce` create instead of default one because it's compatible with Windows
// use `dunce` create instead of default one because it's compatible with Windows UNC paths
// and don't breake cargo compilation on Windows
// https://github.com/rust-lang/rust/issues/42869
let compatible_path = dunce::canonicalize(&dir);
match compatible_path {
Ok(path) => Ok(Utf8PathBuf::from_path_buf(path).unwrap()),
Expand Down

0 comments on commit ad0708a

Please sign in to comment.