Skip to content

Commit

Permalink
fix: attempt at canonicalizing a path
Browse files Browse the repository at this point in the history
  • Loading branch information
ncpenke committed Apr 23, 2024
1 parent ae4d0f7 commit b5c0f0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/candid_parser/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ fn check_actor(env: &Env, actor: &Option<IDLType>) -> Result<Option<Type>> {
}
}

fn resolve_path(base: &Path, file: &str) -> PathBuf {
fn resolve_path(base: &Path, file_str: &str) -> PathBuf {
// TODO use shellexpand to support tilde
let file = PathBuf::from(file);
let file = PathBuf::from(file_str);
if file.is_absolute() {
file
} else {
base.join(file)
std::fs::canonicalize(base.join(file)).expect(&format!("cannot canonicalize {file_str}"))
}
}

Expand Down

0 comments on commit b5c0f0c

Please sign in to comment.