Skip to content

Commit ee75d4d

Browse files
committed
fix: path encoding on wasi
1 parent ea28c4c commit ee75d4d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/file/imp/unix.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ pub fn reopen(_file: &File, _path: &Path) -> io::Result<File> {
108108

109109
#[cfg(not(target_os = "redox"))]
110110
pub fn persist(old_path: &Path, new_path: &Path, overwrite: bool) -> io::Result<()> {
111+
#[cfg(target_os = "wasi")]
112+
let old_path = old_path.as_os_str().as_encoded_bytes();
113+
#[cfg(target_os = "wasi")]
114+
let new_path = new_path.as_os_str().as_encoded_bytes();
115+
111116
if overwrite {
112117
rename(old_path, new_path)?;
113118
} else {

0 commit comments

Comments
 (0)