Skip to content

Use enums for machine constants #1036

@Oshgnacknak

Description

@Oshgnacknak

It might make sense to use enums at

pub const VENDOR_QITECH: u16 = 0x0001;
and following lines.

One can make enum constants equal to const values and automatically get an into() method.

#[repr(u16)]
enum MyEnum {
    Qitech = 1,
    Other = 2
}
const x: u16 = MyEnum::Qitech.into();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions