8000 How to store `Severity` in a field of a struct with `miette-derive`? · Issue #437 · zkat/miette · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

How to store Severity in a field of a struct with miette-derive? #437

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

Open
TheLostLambda opened this issue Apr 26, 2025 · 1 comment
Open

Comments

@TheLostLambda
Copy link
Contributor

I stumbled across this code in kdl-rs, and calling KdlDiagnostic::severity() returns None instead of the value stored in pub severity!

Image

This works (and is what the documentation shows):

Image

But in that case, the severity is fixed to be Warning and doesn't look at severity at all!

I think the docs may benefit from more clearly showing the correct syntax for doing this sort of thing (if the derive macro supports it at all!)

@zkat
Copy link
Owner
zkat commented Apr 27, 2025

Oh. That should probably be #[severity]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0