From 3a79cea8c3f4fc53e98dce74c02019270a320947 Mon Sep 17 00:00:00 2001 From: Moritz Bischof Date: Thu, 11 Jan 2024 04:38:15 +0100 Subject: [PATCH] rename quit-serde to no-serde-warnings, add docs --- README.md | 7 ++++++- macros/Cargo.toml | 2 +- ts-rs/Cargo.toml | 2 +- ts-rs/src/lib.rs | 7 ++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ee2657951..09e29b826 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,11 @@ When running `cargo test`, the TypeScript bindings will be exported to the file Implement `TS` for `Vec` from heapless +- `no-serde-warnings` + + When `serde-compat` is enabled, warnings are printed during build if unsupported serde + attributes are encountered. Enabling this feature silences these warnings. + If there's a type you're dealing with which doesn't implement `TS`, use `#[ts(type = "..")]` or open a PR. @@ -127,7 +132,7 @@ Supported serde attributes: - `flatten` - `default` -When ts-rs encounters an unsupported serde attribute, a warning is emitted. +When ts-rs encounters an unsupported serde attribute, a warning is emitted, unless the feature `no-serde-warnings` is enabled. ### contributing Contributions are always welcome! diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 609f865d8..ce884bb74 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/Aleph-Alpha/ts-rs" [features] serde-compat = ["termcolor"] -quiet-serde = [] +no-serde-warnings = [] [lib] proc-macro = true diff --git a/ts-rs/Cargo.toml b/ts-rs/Cargo.toml index 7c8421471..0651a83bf 100644 --- a/ts-rs/Cargo.toml +++ b/ts-rs/Cargo.toml @@ -29,7 +29,7 @@ default = ["serde-compat"] indexmap-impl = ["indexmap"] ordered-float-impl = ["ordered-float"] heapless-impl = ["heapless"] -quiet-serde = ["ts-rs-macros/quiet-serde"] +no-serde-warnings = ["ts-rs-macros/no-serde-warnings"] [dev-dependencies] serde = { version = "1.0", features = ["derive"] } diff --git a/ts-rs/src/lib.rs b/ts-rs/src/lib.rs index 5706a4ef2..641f24759 100644 --- a/ts-rs/src/lib.rs +++ b/ts-rs/src/lib.rs @@ -107,6 +107,11 @@ //! //! Implement `TS` for `Vec` from heapless //! +//! - `no-serde-warnings` +//! +//! When `serde-compat` is enabled, warnings are printed during build if unsupported serde +//! attributes are encountered. Enabling this feature silences these warnings. +//! //! //! If there's a type you're dealing with which doesn't implement `TS`, use `#[ts(type = "..")]` or open a PR. //! @@ -125,7 +130,7 @@ //! - `flatten` //! - `default` //! -//! When ts-rs encounters an unsupported serde attribute, a warning is emitted. +//! When ts-rs encounters an unsupported serde attribute, a warning is emitted, unless the feature `no-serde-warnings` is enabled. //! //! ## contributing //! Contributions are always welcome!