diff --git a/lib/virtual-fs/src/static_fs.rs b/lib/virtual-fs/src/static_fs.rs index 5ea4846e8ed..ddb9c4a27d3 100644 --- a/lib/virtual-fs/src/static_fs.rs +++ b/lib/virtual-fs/src/static_fs.rs @@ -55,7 +55,7 @@ impl FileOpener for StaticFileSystem { let file = (*self.volumes) .get(&volume) .ok_or(FsError::EntryNotFound)? - .get_file_entry(&format!("{}", path.display())) + .get_file_entry(path.to_string_lossy().as_ref()) .map_err(|_e| FsError::EntryNotFound)?; Ok(Box::new(WebCFile { @@ -69,7 +69,7 @@ impl FileOpener for StaticFileSystem { } None => { for (volume, v) in self.volumes.iter() { - let entry = match v.get_file_entry(&format!("{}", path.display())) { + let entry = match v.get_file_entry(path.to_string_lossy().as_ref()) { Ok(s) => s, Err(_) => continue, // error }; diff --git a/lib/virtual-fs/src/webc_fs.rs b/lib/virtual-fs/src/webc_fs.rs index 13e57cad4a5..96cb806972a 100644 --- a/lib/virtual-fs/src/webc_fs.rs +++ b/lib/virtual-fs/src/webc_fs.rs @@ -90,7 +90,7 @@ where .volumes .get(&volume) .ok_or(FsError::EntryNotFound)? - .get_file_entry(&format!("{}", path.display())) + .get_file_entry(path.to_string_lossy().as_ref()) .map_err(|_e| FsError::EntryNotFound)?; Ok(Box::new(WebCFile { @@ -108,7 +108,7 @@ where None => continue, // error }; - let entry = match v.get_file_entry(&format!("{}", path.display())) { + let entry = match v.get_file_entry(path.to_string_lossy().as_ref()) { Ok(s) => s, Err(_) => continue, // error };