diff --git a/crates/engine/src/rename.rs b/crates/engine/src/rename.rs index 31f4f4ac29..e2e93db27d 100644 --- a/crates/engine/src/rename.rs +++ b/crates/engine/src/rename.rs @@ -100,11 +100,16 @@ fn path_len(path: &Path) -> usize { { path.as_os_str().encode_wide().count() } - #[cfg(not(windows))] + #[cfg(unix)] { use std::os::unix::ffi::OsStrExt; path.as_os_str().as_bytes().len() } + // Neither (the browser build): the encoded length, which only its tests see. + #[cfg(not(any(unix, windows)))] + { + path.as_os_str().len() + } } #[cfg(windows)] use std::os::windows::ffi::OsStrExt;