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

Strip common prefix from enum variants #9

Closed
rkr35 opened this issue Jul 1, 2020 · 0 comments · Fixed by #10
Closed

Strip common prefix from enum variants #9

rkr35 opened this issue Jul 1, 2020 · 0 comments · Fixed by #10
Labels
enhancement New feature or request

Comments

@rkr35
Copy link
Owner

rkr35 commented Jul 1, 2020

Here's what a generated enum looks like:

#[repr(u8)]
pub enum EInterpCurveMode {
    CIM_Linear,
    CIM_CurveAuto,
    CIM_Constant,
    CIM_CurveUser,
    CIM_CurveBreak,
    CIM_CurveAutoClamped,
    CIM_MAX,
}

Since the variants of a Rust enum do not pollute the namespace that contains the enum, there is no need to prepend a common prefix to each enum variant. We should also normalize variant names so they are always PascalCase.

Here's how we should generate the above enum:

#[repr(u8)]
pub enum EInterpCurveMode {
    Linear,
    CurveAuto,
    Constant,
    CurveUser,
    CurveBreak,
    CurveAutoClamped,
    Max,
}
@rkr35 rkr35 added the enhancement New feature or request label Jul 1, 2020
@rkr35 rkr35 closed this as completed in #10 Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant