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
When compiling a Rust project using cpal for wasm32-unknown-emscripten, the build fails due to multiple errors:
Duplicate module definition (E0428):
error[E0428]: the name `platform_impl` is defined multiple times
--> cpal-0.15.3/src/platform/mod.rs:640:1
622 | mod platform_impl {
| ----------------- previous definition of the module `platform_impl` here
...
640 | mod platform_impl {
| ^^^^^^^^^^^^^^^^^ `platform_impl` redefined here
It seems like platform_impl is being defined twice, likely due to conditional compilation issues.
Type mismatch (E0308) in into_abi function:
error[E0308]: mismatched types
--> cpal-0.15.3/src/lib.rs:248:9
247 | fn into_abi(self) -> Self::Abi {
| --------- expected `Option<u32>` because of return type
248 | match self {
249 | Self::Default => None,
250 | Self::Fixed(fc) => Some(fc),
251 | }
252 | .into_abi()
| ___________________^ expected `Option<u32>`, found `f64`
The into_abi() function appears to be returning a f64, whereas the expected type is Option<u32>.
Steps to Reproduce:
Create a Rust project with cpal = "0.15.3" in Cargo.toml.
cargo new --bin cpal_test
cd cpal_test
cargo add cpal --version 0.15.3