gir: Enum generation error for GstMpegts

In the file GstMpegts-1.0.gir there is an enum with specification starting:

    <enumeration name="DVBCodeRate" c:type="GstMpegtsDVBCodeRate">
      <member name="none" value="0" c:identifier="GST_MPEGTS_FEC_NONE">
      </member>
      <member name="1_2" value="1" c:identifier="GST_MPEGTS_FEC_1_2">
      </member>
      <member name="2_3" value="2" c:identifier="GST_MPEGTS_FEC_2_3">
      </member>
      <member name="3_4" value="3" c:identifier="GST_MPEGTS_FEC_3_4">
      </member>
      <member name="4_5" value="4" c:identifier="GST_MPEGTS_FEC_4_5">
      </member>

this generates the output starting:

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum DVBCodeRate {
    None,
    12,
    23,
    34,
    45,

which isn’t valid Rust code. 😦

Am I just missing an option in using gir:

gir -d ../gir-files -o . -c ../Gir_GstMpegts.toml

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 23 (11 by maintainers)

Most upvoted comments

No idea what the idiomatic Rust version of an enum with multiple number components would be, someone should check that first and then implement conversion accordingly.