Skip to content

Commit 86e03dd

Browse files
committed
Emit a compiler error if neither the json or the js features are enabled
I migrated some code from tsify to tsify-next and was scratching my head at all the compiler errors like ``` const `CONFIG` is not a member of trait `Tsify` ``` and ``` associated constant in `impl` without body ``` Turns out, I was using tsify without default features, and I think it must have been defaulting to
1 parent dfc1d32 commit 86e03dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#![allow(clippy::wrong_self_convention)]
22

3+
#[cfg(not(any(feature = "json", feature = "js")))]
4+
compile_error!(
5+
"Either the \"json\" or \"js\" feature must be enabled for tsify to function properly"
6+
);
7+
38
#[cfg(all(feature = "json", not(feature = "js")))]
49
pub use gloo_utils::format::JsValueSerdeExt;
510
#[cfg(feature = "js")]

0 commit comments

Comments
 (0)