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

Align enum values in consecutive lines #1686

Closed
kornelski opened this issue Jun 15, 2017 · 1 comment
Closed

Align enum values in consecutive lines #1686

kornelski opened this issue Jun 15, 2017 · 1 comment

Comments

@kornelski
Copy link

Related to #1684

pub enum ColorimetricIntentImageState {
    SceneColorimetryEstimates =              0x73636F65,
    SceneAppearanceEstimates =               0x73617065,
    FocalPlaneColorimetryEstimates =         0x66706365,
    ReflectionHardcopyOriginalColorimetry =  0x72686F63,
    ReflectionPrintOutputColorimetry =       0x72706F63,
}

is changed to:

pub enum ColorimetricIntentImageState {
    SceneColorimetryEstimates = 0x73636F65,
    SceneAppearanceEstimates = 0x73617065,
    FocalPlaneColorimetryEstimates = 0x66706365,
    ReflectionHardcopyOriginalColorimetry = 0x72686F63,
    ReflectionPrintOutputColorimetry = 0x72706F63,
}

and IMHO it looks sloppy. I'd prefer all numbers to be in the same column. Of course maintaining such alignment by hand is tedious, so rustfmt would be especially useful in this case.

I also have enums where the values are related (e.g. ranges of consecutive numbers, powers of two, unions of flags), so having the values exactly one under another helps seeing the patterns.

@nrc nrc added the duplicate label Jun 15, 2017
@nrc
Copy link
Member

nrc commented Jun 15, 2017

This is a dup of #1103 (and I think one or two other issues). It is somewhat complex for Rustfmt to implement and isn't part of the RFC style, so is unlikely to get implemented soon.

@nrc nrc closed this as completed Jun 15, 2017
moxian added a commit to moxian/rustfmt that referenced this issue Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants