-
Notifications
You must be signed in to change notification settings - Fork 889
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
[unstable option] reorder_impl_items #3363
Comments
Should reorganized elements maintain their original order? Example: pub trait MyTrait {
type c;
type b;
type a;
} So after formatting instead of this: impl MyStruct for MyTrait {
type a = ();
type b = ();
type c = ();
...
} we have this: impl MyStruct for MyTrait {
type c = ();
type b = ();
type a = ();
...
} |
The current behavior is intentional, though whether that's ultimately desirable is a different question. It's possible we my need something along the lines of what we have for imports with |
What you expect is a |
I would also prefer if reordering of trait impls follows the order of the trait definition (at least for locally defined traits). I have a case where there are multiple EDIT: There's even a trait in impl IntoIterator for Foo {
type IntoIter = FooIter;
type Item = ();
fn into_iter(self) -> FooIter {
FooIter
}
} Given it's probably not really wanted to reorder items based on the order defined by external code (since that's dependency version specific), I guess my preference would just be splitting grouping and sorting into separate options so I can have the grouping without sorting. |
Tracking issue for unstable option: reorder_impl_items
The text was updated successfully, but these errors were encountered: