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

Add option to disable warnings printed from macro during build #108

Closed
ssnover opened this issue Jun 20, 2022 · 3 comments
Closed

Add option to disable warnings printed from macro during build #108

ssnover opened this issue Jun 20, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@ssnover
Copy link

ssnover commented Jun 20, 2022

We're making use of this crate for generating typescript types for communication with a TS application and it functions great! I've recently been cleaning up warnings across the codebase and came across these warnings:

warning: failed to parse serde attribute
  | 
  | #[serde(deny_unknown_fields)]
  | 
  = note: ts-rs failed to parse this attribute. It will be ignored.

Since it looks like they're generated internal to the macro by printing to the console, there is no way to turn them off and they spam repeatedly. It'd be nice if these could be opt-out with a feature or something as there isn't enough information to do anything about the warning (no line number, struct name) and I suspect that they're outside our source as well.

@NyxCode NyxCode added the enhancement New feature or request label Jul 28, 2022
@rcvfdmark
Copy link

I have a fork of this change, which it turns out is trivial.

@escritorio-gustavo
Copy link
Contributor

This was implemented in #185, and the feature flag was renamed to no-serde-warnings in #189 with a small oversight that was fixed in #191

Just add this to your Cargo.toml

[dependencies]
ts-rs = { version = "7.1.1", features = ["no-serde-warnings"] }

@NyxCode
Copy link
Collaborator

NyxCode commented Jan 26, 2024

Let's hope #54140 comes around soon, so we can do this properly!

Nutomic added a commit to LemmyNet/lemmy that referenced this issue Jan 29, 2024
dessalines pushed a commit to LemmyNet/lemmy that referenced this issue Jan 29, 2024
* Silence warnings from ts-rs

Aleph-Alpha/ts-rs#108

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants