Skip to content

Consider use of #[non_exhaustive] #382

@LPardue

Description

@LPardue

I'm sure if this is work the effort but about a year ago I tried to add HTTP/3 to the Version enum and we hit the problem with exhaustive matching. That was independently fixed by adding a __NonExhaustive variant see https://github.com/hyperium/http/blob/master/src/version.rs#L52

In Rust 1.40 the #[non-exhaustive] attribute was landed https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html#[non_exhaustive]-structs,-enums,-and-variants, so is there any benefit switching to that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions