You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
Our `web_asset` example does not build on Wasm. Ironic.
As reported in #21280, there are a few problems:
1. Imports are broken: one hard error and a few warnings.
2. `HttpWasmAssetReader` needs a `+ use<'>` to conform to the Rust 2024
edition (unreported, but discovered)
3. We're returning a reference to a temporary value, which is ultimately
caused by 2
## Solution
1. Move the imports into the correct feature-gated block.
2. Slap some `+ use<'>` on the function definition like the compiler
told me to. This fixes the "returning a reference to a temporary value"
problem, as we're no longer implicitly capturing.
Fixes#21280.
Special thanks to @kristoff3r for pointing out my mistake!
## Testing
I've tested this PR using `bevy run --features https --example web_asset
web` via the bevy_cli. Because of changes to `getrandom`, this was
non-trivial to build for web manually.
0 commit comments