diff --git a/crates/bevy_asset/src/io/wasm.rs b/crates/bevy_asset/src/io/wasm.rs index 4080e03ecd..4ed7162d2b 100644 --- a/crates/bevy_asset/src/io/wasm.rs +++ b/crates/bevy_asset/src/io/wasm.rs @@ -47,7 +47,7 @@ fn js_value_to_err(context: &str) -> impl FnOnce(JsValue) -> std::io::Error + '_ } }; - std::io::Error::new(std::io::ErrorKind::Other, message) + std::io::Error::other(message) } } @@ -62,10 +62,7 @@ impl HttpWasmAssetReader { let worker: web_sys::WorkerGlobalScope = global.unchecked_into(); worker.fetch_with_str(path.to_str().unwrap()) } else { - let error = std::io::Error::new( - std::io::ErrorKind::Other, - "Unsupported JavaScript global context", - ); + let error = std::io::Error::other("Unsupported JavaScript global context"); return Err(AssetReaderError::Io(error.into())); }; let resp_value = JsFuture::from(promise)