Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does web_sys::AudioBuffer::copy_to_channel* need a mutable buffer argument? #2434

Closed
kerskuchen opened this issue Jan 25, 2021 · 2 comments · Fixed by #2436
Closed

Why does web_sys::AudioBuffer::copy_to_channel* need a mutable buffer argument? #2434

kerskuchen opened this issue Jan 25, 2021 · 2 comments · Fixed by #2436
Labels

Comments

@kerskuchen
Copy link
Contributor

kerskuchen commented Jan 25, 2021

Summary

I hope this is the correct place to ask this. Currently I am slightly confused as to why the APIs

web_sys::AudioBuffer::copy_to_channel
https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.AudioBuffer.html#method.copy_to_channel

and

web_sys::AudioBuffer::copy_to_channel_with_start_in_channel
https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.AudioBuffer.html#method.copy_to_channel_with_start_in_channel

need their first argument (the source buffer to be copied from) to be mutable.

Additional Details

https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel

@alexcrichton
Copy link
Contributor

There's a whitelist of functions which are known to not need mutable slices, and it looks like this isn't on that list.

@kerskuchen
Copy link
Contributor Author

Ah thanks for the clarification. I will try make a PR then to fix this.

kerskuchen added a commit to kerskuchen/wasm-bindgen that referenced this issue Jan 26, 2021
alexcrichton pushed a commit that referenced this issue Jan 26, 2021
…mutable (#2434) (#2436)

* Makes slice argument of `web_sys::AudioBuffer::copy_to_channel*` non mutable (#2434)

* Commit newly generated API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants