Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable serde warnings: rename quit-serde to no-serde-warnings, add docs #189

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ts-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
7 changes: 6 additions & 1 deletion ts-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//!
Expand All @@ -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!
Expand Down
Loading