Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types' names that start with a number in input gir file produce invalid code #1443

Open
AbuShawarib opened this issue Feb 9, 2023 · 0 comments

Comments

@AbuShawarib
Copy link

AbuShawarib commented Feb 9, 2023

If you use a gir file that start some of its elements' names by a number, like network-manager's gir file:

...

<bitfield name="80211ApFlags"
              glib:type-name="NM80211ApFlags"
              glib:get-type="nm_802_11_ap_flags_get_type"
              c:type="NM80211ApFlags">

...

<enumeration name="80211Mode"
                 glib:type-name="NM80211Mode"
                 glib:get-type="nm_802_11_mode_get_type"
                 c:type="NM80211Mode">

...

This crate will produce invalid rust code:

...

impl fmt::Display for 80211ApFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

...

pub enum 80211Mode {
    #[doc(alias = "NM_802_11_MODE_UNKNOWN")]
    Unknown,
    #[doc(alias = "NM_802_11_MODE_ADHOC")]
    Adhoc,

...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant