Rustfmt: [unstable option] reorder_impl_items

Created on 13 Feb 2019  路  1Comment  路  Source: rust-lang/rustfmt

Tracking issue for unstable option: reorder_impl_items

unstable option

Most helpful comment

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 = ();
   ...
}

>All 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 = ();
   ...
}
Was this page helpful?
0 / 5 - 0 ratings