This commit is contained in:
Peter Hayman 2025-05-18 12:30:15 +10:00
parent 11a656d7c5
commit 5e9f05c4b9

View File

@ -66,11 +66,7 @@ async fn get(path: PathBuf) -> Result<Box<dyn Reader>, AssetReaderError> {
let str_path = path.to_str().ok_or_else(|| { let str_path = path.to_str().ok_or_else(|| {
AssetReaderError::Io( AssetReaderError::Io(
io::Error::new( io::Error::other(std::format!("non-utf8 path: {}", path.display())).into(),
io::ErrorKind::Other,
std::format!("non-utf8 path: {}", path.display()),
)
.into(),
) )
})?; })?;
@ -104,14 +100,11 @@ async fn get(path: PathBuf) -> Result<Box<dyn Reader>, AssetReaderError> {
} }
} }
Err(err) => Err(AssetReaderError::Io( Err(err) => Err(AssetReaderError::Io(
io::Error::new( io::Error::other(std::format!(
io::ErrorKind::Other, "unexpected error while loading asset {}: {}",
std::format!( path.display(),
"unexpected error while loading asset {}: {}", err
path.display(), ))
err
),
)
.into(), .into(),
)), )),
} }