Skip to content

Commit ee2ddc9

Browse files
committed
fix: restrict wasm-bindgen to wasm32 target
1 parent 9f8705d commit ee2ddc9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub type OutputDevices<I> = DevicesFiltered<I>;
200200
pub type ChannelCount = u16;
201201

202202
/// The number of samples processed per second for a single channel of audio.
203-
#[cfg_attr(feature = "wasm-bindgen", wasm_bindgen)]
203+
#[cfg_attr(all(target_arch = "wasm32", feature = "wasm-bindgen"), wasm_bindgen)]
204204
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
205205
pub struct SampleRate(pub u32);
206206

@@ -374,7 +374,7 @@ impl wasm_bindgen::convert::IntoWasmAbi for BufferSize {
374374
/// The sample format is omitted in favour of using a sample type.
375375
///
376376
/// See also [`BufferSize`] for details on buffer size behavior and latency considerations.
377-
#[cfg_attr(feature = "wasm-bindgen", wasm_bindgen)]
377+
#[cfg_attr(all(target_arch = "wasm32", feature = "wasm-bindgen"), wasm_bindgen)]
378378
#[derive(Clone, Debug, Eq, PartialEq)]
379379
pub struct StreamConfig {
380380
pub channels: ChannelCount,

src/platform/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ mod platform_impl {
844844
target_os = "ios",
845845
target_os = "emscripten",
846846
target_os = "android",
847-
all(target_arch = "wasm32", feature = "wasm-bindgen"),
847+
target_arch = "wasm32",
848848
)))]
849849
mod platform_impl {
850850
#[cfg_attr(
@@ -859,7 +859,7 @@ mod platform_impl {
859859
target_os = "ios",
860860
target_os = "emscripten",
861861
target_os = "android",
862-
all(target_arch = "wasm32", feature = "wasm-bindgen")
862+
target_arch = "wasm32"
863863
))))
864864
)]
865865
pub use crate::host::null::Host as NullHost;

src/samples_formats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub use dasp_sample::U24;
4848
///
4949
/// [`is_float`]: SampleFormat::is_float
5050
/// [`supported_input_configs`]: crate::traits::DeviceTrait::supported_input_configs
51-
#[cfg_attr(feature = "wasm-bindgen", wasm_bindgen)]
51+
#[cfg_attr(all(target_arch = "wasm32", feature = "wasm-bindgen"), wasm_bindgen)]
5252
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
5353
#[non_exhaustive]
5454
pub enum SampleFormat {

0 commit comments

Comments
 (0)