Rename: the path length is checked on targets that are neither Unix nor Windows too (browser build)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
Osvaldo Duran Melendez
2026-11-12 07:33:50 -05:00
co-authored by Claude Sonnet 5.5
parent 894fd5a25a
commit 440a7f89a2
+6 -1
View File
@@ -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;