Closed
Description
I always try to keep derives in a certain order, so they are uniform with the rest of the crate. It would be nice if rustfmt
could automatically sort them :)
I could imagine sorting them:
-
alphabetically:
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-
after some sort of priority
I like the order in which the traits are listed in the rust-api-guidelines#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Display, Default)]
I think they simply grouped similar traits together:
Copy
+Clone
Eq
+PartialEq
Ord
+PartialOrd
Debug
+Display