Skip to content

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

@TheLostLambda

Description

@TheLostLambda

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!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions