Skip to content

No way to map enum? #196

@lattice0

Description

@lattice0

Hi, it's not possible to map with enum keys?

pub enum AVPixelFormat {
    AV_PIX_FMT_NONE=-1,
    AV_PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
    AV_PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
    //...


static KEYWORDS: phf::Map<AVPixelFormat, PixelFormat> = phf_map! {
    AVPixelFormat::AV_PIX_FMT_YUV420P => PixelFormat {
    //...

error: unsupported key expression
  --> src/common/pixel_formats_impl.rs:29:5
   |
29 |     AVPixelFormat::AV_PIX_FMT_YUV420P => PixelFormat {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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