diff --git a/crates/bevy_asset/src/io/wasm.rs b/crates/bevy_asset/src/io/wasm.rs index 125543fc11..c2551a40f1 100644 --- a/crates/bevy_asset/src/io/wasm.rs +++ b/crates/bevy_asset/src/io/wasm.rs @@ -52,7 +52,7 @@ fn js_value_to_err(context: &str) -> impl FnOnce(JsValue) -> std::io::Error + '_ } impl HttpWasmAssetReader { - async fn fetch_bytes<'a>(&self, path: PathBuf) -> Result { + async fn fetch_bytes(&self, path: PathBuf) -> Result { // The JS global scope includes a self-reference via a specializing name, which can be used to determine the type of global context available. let global: Global = js_sys::global().unchecked_into(); let promise = if !global.window().is_undefined() { diff --git a/crates/bevy_gltf/src/loader/gltf_ext/mesh.rs b/crates/bevy_gltf/src/loader/gltf_ext/mesh.rs index 90c838b468..e226c59aec 100644 --- a/crates/bevy_gltf/src/loader/gltf_ext/mesh.rs +++ b/crates/bevy_gltf/src/loader/gltf_ext/mesh.rs @@ -14,9 +14,12 @@ pub(crate) fn primitive_name(mesh: &Mesh<'_>, primitive: &Primitive) -> String { } /// Maps the `primitive_topology` from glTF to `wgpu`. -#[expect( - clippy::result_large_err, - reason = "`GltfError` is only barely past the threshold for large errors." +#[cfg_attr( + not(target_arch = "wasm32"), + expect( + clippy::result_large_err, + reason = "`GltfError` is only barely past the threshold for large errors." + ) )] pub(crate) fn primitive_topology(mode: Mode) -> Result { match mode { diff --git a/crates/bevy_gltf/src/loader/gltf_ext/mod.rs b/crates/bevy_gltf/src/loader/gltf_ext/mod.rs index 558ed645dd..36c3809a53 100644 --- a/crates/bevy_gltf/src/loader/gltf_ext/mod.rs +++ b/crates/bevy_gltf/src/loader/gltf_ext/mod.rs @@ -14,9 +14,12 @@ use super::GltfError; use self::{material::extension_texture_index, scene::check_is_part_of_cycle}; -#[expect( - clippy::result_large_err, - reason = "need to be signature compatible with `load_gltf`" +#[cfg_attr( + not(target_arch = "wasm32"), + expect( + clippy::result_large_err, + reason = "need to be signature compatible with `load_gltf`" + ) )] /// Checks all glTF nodes for cycles, starting at the scene root. pub(crate) fn check_for_cycles(gltf: &Gltf) -> Result<(), GltfError> { diff --git a/crates/bevy_gltf/src/loader/gltf_ext/scene.rs b/crates/bevy_gltf/src/loader/gltf_ext/scene.rs index 7845280b18..62174dc296 100644 --- a/crates/bevy_gltf/src/loader/gltf_ext/scene.rs +++ b/crates/bevy_gltf/src/loader/gltf_ext/scene.rs @@ -43,9 +43,12 @@ pub(crate) fn node_transform(node: &Node) -> Transform { } } -#[expect( - clippy::result_large_err, - reason = "need to be signature compatible with `load_gltf`" +#[cfg_attr( + not(target_arch = "wasm32"), + expect( + clippy::result_large_err, + reason = "need to be signature compatible with `load_gltf`" + ) )] /// Check if [`Node`] is part of cycle pub(crate) fn check_is_part_of_cycle( diff --git a/crates/bevy_gltf/src/loader/mod.rs b/crates/bevy_gltf/src/loader/mod.rs index e4765f43e9..5e8c7f90cb 100644 --- a/crates/bevy_gltf/src/loader/mod.rs +++ b/crates/bevy_gltf/src/loader/mod.rs @@ -1281,9 +1281,12 @@ fn load_material( } /// Loads a glTF node. -#[expect( - clippy::result_large_err, - reason = "`GltfError` is only barely past the threshold for large errors." +#[cfg_attr( + not(target_arch = "wasm32"), + expect( + clippy::result_large_err, + reason = "`GltfError` is only barely past the threshold for large errors." + ) )] fn load_node( gltf_node: &Node, diff --git a/crates/bevy_remote/src/builtin_methods.rs b/crates/bevy_remote/src/builtin_methods.rs index 1638c4a47f..e8b6856623 100644 --- a/crates/bevy_remote/src/builtin_methods.rs +++ b/crates/bevy_remote/src/builtin_methods.rs @@ -28,7 +28,7 @@ use crate::{ BrpError, BrpResult, }; -#[cfg(feature = "http")] +#[cfg(all(feature = "http", not(target_family = "wasm")))] use {crate::schemas::open_rpc::ServerObject, bevy_utils::default}; /// The method path for a `bevy/get` request. @@ -821,7 +821,7 @@ pub fn process_remote_list_methods_request( ) -> BrpResult { let remote_methods = world.resource::(); - #[cfg(feature = "http")] + #[cfg(all(feature = "http", not(target_family = "wasm")))] let servers = match ( world.get_resource::(), world.get_resource::(), @@ -839,7 +839,7 @@ pub fn process_remote_list_methods_request( _ => None, }; - #[cfg(not(feature = "http"))] + #[cfg(any(not(feature = "http"), target_family = "wasm"))] let servers = None; let doc = OpenRpcDocument { diff --git a/crates/bevy_winit/src/state.rs b/crates/bevy_winit/src/state.rs index f1926275ab..0a775293f7 100644 --- a/crates/bevy_winit/src/state.rs +++ b/crates/bevy_winit/src/state.rs @@ -16,7 +16,9 @@ use bevy_input::{ gestures::*, mouse::{MouseButtonInput, MouseMotion, MouseScrollUnit, MouseWheel}, }; -use bevy_log::{error, trace, warn}; +#[cfg(any(not(target_arch = "wasm32"), feature = "custom_cursor"))] +use bevy_log::error; +use bevy_log::{trace, warn}; #[cfg(feature = "custom_cursor")] use bevy_math::URect; use bevy_math::{ivec2, DVec2, Vec2};