order derivable traits lists

Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
This commit is contained in:
Clément DAVID 2017-08-23 14:10:08 +02:00
parent ab73f3d61d
commit c5fe235112
194 changed files with 553 additions and 552 deletions

View file

@ -7,7 +7,7 @@ use parser::SelectorImpl;
use std::ascii::AsciiExt;
use std::fmt;
#[derive(Eq, PartialEq, Clone)]
#[derive(Clone, Eq, PartialEq)]
pub struct AttrSelectorWithNamespace<Impl: SelectorImpl> {
pub namespace: NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>,
pub local_name: Impl::LocalName,
@ -27,7 +27,7 @@ impl<Impl: SelectorImpl> AttrSelectorWithNamespace<Impl> {
}
}
#[derive(Eq, PartialEq, Clone)]
#[derive(Clone, Eq, PartialEq)]
pub enum NamespaceConstraint<NamespaceUrl> {
Any,
@ -35,7 +35,7 @@ pub enum NamespaceConstraint<NamespaceUrl> {
Specific(NamespaceUrl),
}
#[derive(Eq, PartialEq, Clone)]
#[derive(Clone, Eq, PartialEq)]
pub enum ParsedAttrSelectorOperation<AttrValue> {
Exists,
WithValue {
@ -45,7 +45,7 @@ pub enum ParsedAttrSelectorOperation<AttrValue> {
}
}
#[derive(Eq, PartialEq, Clone)]
#[derive(Clone, Eq, PartialEq)]
pub enum AttrSelectorOperation<AttrValue> {
Exists,
WithValue {
@ -66,7 +66,7 @@ impl<AttrValue> AttrSelectorOperation<AttrValue> {
}
}
#[derive(Eq, PartialEq, Clone, Copy)]
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum AttrSelectorOperator {
Equal,
Includes,
@ -127,7 +127,7 @@ impl AttrSelectorOperator {
/// The definition of whitespace per CSS Selectors Level 3 § 4.
pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C'];
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ParsedCaseSensitivity {
CaseSensitive,
AsciiCaseInsensitive,
@ -150,7 +150,7 @@ impl ParsedCaseSensitivity {
}
}
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CaseSensitivity {
CaseSensitive,
AsciiCaseInsensitive,

View file

@ -183,7 +183,7 @@ fn split_from_end<T>(s: &[T], at: usize) -> (&[T], &[T]) {
pub const HAS_PSEUDO_BIT: u32 = 1 << 30;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct SpecificityAndFlags(pub u32);
impl SpecificityAndFlags {

View file

@ -9,7 +9,7 @@ use bloom::BloomFilter;
///
/// There are two modes of selector matching. The difference is only noticeable
/// in presence of pseudo-elements.
#[derive(Debug, PartialEq, Copy, Clone)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MatchingMode {
/// Don't ignore any pseudo-element selectors.
Normal,
@ -29,7 +29,7 @@ pub enum MatchingMode {
}
/// The mode to use when matching unvisited and visited links.
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum VisitedHandlingMode {
/// All links are matched as if they are unvisted.
AllLinksUnvisited,
@ -48,7 +48,7 @@ pub enum VisitedHandlingMode {
/// Which quirks mode is this document in.
///
/// See: https://quirks.spec.whatwg.org/
#[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum QuirksMode {
/// Quirks mode.
Quirks,

View file

@ -5,7 +5,7 @@
//! These types need to have the same size and alignment as the respectively corresponding
//! types in components/style/gecko/selector_parser.rs
#[derive(Eq, PartialEq, Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
#[allow(dead_code)]
pub enum PseudoClass {
Bare,
@ -13,15 +13,15 @@ pub enum PseudoClass {
MozAny(Box<[()]>),
}
#[derive(Eq, PartialEq, Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum PseudoElement {
A,
B,
Tree(Box<[String]>),
}
#[derive(Eq, PartialEq, Clone, Debug, Default)]
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct Atom(usize);
#[derive(Eq, PartialEq, Clone)]
#[derive(Clone, Eq, PartialEq)]
pub struct Impl;

View file

@ -215,7 +215,7 @@ fn may_match<E>(hashes: &AncestorHashes,
/// and `is_unvisited` are based on relevant link state of only the current
/// complex selector being matched (not the global relevant link status for all
/// selectors in `MatchingContext`).
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum RelevantLinkStatus {
/// Looking for a possible relevant link. This is the initial mode when
/// matching a selector.
@ -352,7 +352,7 @@ impl RelevantLinkStatus {
/// However since the selector "c1" raises
/// NotMatchedAndRestartFromClosestDescendant. So the selector
/// "b1 + c1 > b2 ~ " doesn't match and restart matching from "d1".
#[derive(PartialEq, Eq, Copy, Clone)]
#[derive(Clone, Copy, Eq, PartialEq)]
enum SelectorMatchingResult {
Matched,
NotMatchedAndRestartFromClosestLaterSibling,

View file

@ -170,7 +170,7 @@ pub trait Parser<'i> {
}
}
#[derive(PartialEq, Eq, Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct SelectorList<Impl: SelectorImpl>(pub Vec<Selector<Impl>>);
impl<Impl: SelectorImpl> SelectorList<Impl> {
@ -206,7 +206,7 @@ impl<Impl: SelectorImpl> SelectorList<Impl> {
/// off the upper bits) at the expense of making the fourth somewhat more
/// complicated to assemble, because we often bail out before checking all the
/// hashes.
#[derive(Eq, PartialEq, Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AncestorHashes {
pub packed_hashes: [u32; 3],
}
@ -575,7 +575,7 @@ impl<'a, Impl: SelectorImpl> Iterator for AncestorIter<'a, Impl> {
}
}
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Combinator {
Child, // >
Descendant, // space
@ -613,7 +613,7 @@ impl Combinator {
/// optimal packing and cache performance, see [1].
///
/// [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1357973
#[derive(Eq, PartialEq, Clone)]
#[derive(Clone, Eq, PartialEq)]
pub enum Component<Impl: SelectorImpl> {
Combinator(Combinator),
@ -712,7 +712,7 @@ impl<Impl: SelectorImpl> Component<Impl> {
}
}
#[derive(Eq, PartialEq, Clone)]
#[derive(Clone, Eq, PartialEq)]
pub struct LocalName<Impl: SelectorImpl> {
pub name: Impl::LocalName,
pub lower_name: Impl::LocalName,
@ -1694,14 +1694,14 @@ pub mod tests {
use std::fmt;
use super::*;
#[derive(PartialEq, Clone, Debug, Eq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum PseudoClass {
Hover,
Active,
Lang(String),
}
#[derive(Eq, PartialEq, Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum PseudoElement {
Before,
After,
@ -1749,7 +1749,7 @@ pub mod tests {
where V: SelectorVisitor<Impl = Self::Impl> { true }
}
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, Debug, PartialEq)]
pub struct DummySelectorImpl;
#[derive(Default)]
@ -1786,7 +1786,7 @@ pub mod tests {
}
}
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)]
pub struct DummyAtom(String);
impl fmt::Display for DummyAtom {