Skip to content

Commit de1d3c1

Browse files
committed
Try accepting types in WASM export_codec
1 parent 3baf9c4 commit de1d3c1

File tree

1 file changed

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

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,18 @@ pub mod bindings {
7474
/// export_codec!(MyCodec);
7575
/// ```
7676
macro_rules! export_codec {
77-
($codec:ident) => {
77+
($codec:ty) => {{
78+
type Codec = $codec;
79+
7880
const _: () = {
7981
const fn can_only_export_static_codec<T: $crate::numcodecs::StaticCodec>() {}
8082

8183
can_only_export_static_codec::<$codec>()
8284
};
8385

8486
#[cfg(target_arch = "wasm32")]
85-
$crate::bindings::export!($codec with_types_in $crate::bindings);
86-
};
87+
$crate::bindings::export!(Codec with_types_in $crate::bindings);
88+
}};
8789
}
8890

8991
#[cfg(target_arch = "wasm32")]

0 commit comments

Comments
 (0)