Skip to content

Commit 1c9b549

Browse files
committed
Try better scoping for wasm codec export
1 parent d1b86fd commit 1c9b549

File tree

1 file changed

+5
-6
lines changed
  • crates/numcodecs-wasm-guest/src

1 file changed

+5
-6
lines changed

crates/numcodecs-wasm-guest/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,15 @@ pub mod bindings {
8080
/// ```
8181
macro_rules! export_codec {
8282
($codec:ty) => {
83-
type Codec = $codec;
84-
8583
const _: () = {
86-
const fn can_only_export_static_codec<T: $crate::numcodecs::StaticCodec>() {}
84+
type Codec = $codec;
85+
86+
#[cfg(target_arch = "wasm32")]
87+
$crate::bindings::export!(Codec with_types_in $crate::bindings);
8788

89+
const fn can_only_export_static_codec<T: $crate::numcodecs::StaticCodec>() {}
8890
can_only_export_static_codec::<Codec>()
8991
};
90-
91-
#[cfg(target_arch = "wasm32")]
92-
$crate::bindings::export!(Codec with_types_in $crate::bindings);
9392
};
9493
}
9594

0 commit comments

Comments
 (0)