diff --git a/crates/bevy_asset/src/io/file_asset_io.rs b/crates/bevy_asset/src/io/file_asset_io.rs index f915e512d274e..5f2ede7ba988f 100644 --- a/crates/bevy_asset/src/io/file_asset_io.rs +++ b/crates/bevy_asset/src/io/file_asset_io.rs @@ -45,13 +45,14 @@ impl AssetIo for FileAssetIo { fn load_path<'a>(&'a self, path: &'a Path) -> BoxedFuture<'a, Result, AssetIoError>> { Box::pin(async move { let mut bytes = Vec::new(); - match File::open(self.root_path.join(path)) { + let full_path = self.root_path.join(path); + match File::open(&full_path) { Ok(mut file) => { file.read_to_end(&mut bytes)?; } Err(e) => { return if e.kind() == std::io::ErrorKind::NotFound { - Err(AssetIoError::NotFound(path.to_owned())) + Err(AssetIoError::NotFound(full_path)) } else { Err(e.into()) }