You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also I believe it would be nice to support different formatting styles. I came up with the following options:
Preserve (default). Leave the literal as-is.
Always. Add a trailing zero to the literal. E.g. 1.0, 2.0e10, 3.0f32.
IfNoPostfix. Add a trailing zero by default. If the literal contains an exponent or a suffix, the zero and the preceding period are removed. E.g. 1.0, 2e10, 3f32.
Never. Remove the trailing zero. If the literal contains an exponent or a suffix, the preceding period is also removed. E.g. 1., 2e10, 3f32.
Thanks for taking the time to look into this and for submitting a PR! I think this is a configuration rustfmt could support, and the different options you've outlined here make sense to me. I'll try to carve out some time over the next few days to review and provide feedback on your implementation 😁
Essentially, these reformats should be done for consistency and readability:
So
1.
would become1.0
and.1
would become0.1
.The text was updated successfully, but these errors were encountered: