Skip to content

ban instantiation of protobuf enum variant: Unspecified  #8367

@kwannoel

Description

@kwannoel

So far, in our codebase, we don't use Unspecified variant of protobuf enums. However It is required by protobuf format: https://cloud.google.com/apis/design/design_patterns#enum_default_value.

It can be a source of bugs as seen in #8360.

We will have occurrences of it, since we need to handle protobuf messages. However should ban its instantiation, e.g.

let x = <MESSAGE>::Unspecified

We can do so via clippy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions