Skip to content

Commit

Permalink
perf: use custom canonicalize on non Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jul 9, 2024
1 parent 176dc45 commit bd0509c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/file_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ impl FileSystem for FileSystemOs {
}

fn canonicalize(&self, path: &Path) -> io::Result<PathBuf> {
#[cfg(not(target_os = "wasi"))]
#[cfg(target_os = "windows")]
{
dunce::canonicalize(path)
}
#[cfg(target_os = "wasi")]
#[cfg(not(target_os = "windows"))]
{
let meta = fs::symlink_metadata(path)?;
if meta.file_type().is_symlink() {
Expand Down

0 comments on commit bd0509c

Please sign in to comment.