Don't complete already used derive attributes
This commit is contained in:
parent
8f936c5571
commit
a92ed1eef4
1 changed files with 20 additions and 20 deletions
|
|
@ -31,6 +31,8 @@ pub(super) fn complete_derive(
|
|||
let lookup = components.join(", ");
|
||||
let label = components.iter().rev().join(", ");
|
||||
(label, Some(lookup))
|
||||
} else if existing_derives.contains(&derive) {
|
||||
continue;
|
||||
} else {
|
||||
(derive, None)
|
||||
};
|
||||
|
|
@ -139,16 +141,15 @@ pub macro Ord {}
|
|||
check(
|
||||
r#"#[derive(serde::Serialize, PartialEq, $0)] struct Test;"#,
|
||||
expect![[r#"
|
||||
at PartialEq
|
||||
at Default
|
||||
at Eq
|
||||
at Eq, PartialOrd, Ord
|
||||
at Clone, Copy
|
||||
at Debug
|
||||
at Clone
|
||||
at Hash
|
||||
at PartialOrd
|
||||
"#]],
|
||||
at Default
|
||||
at Eq
|
||||
at Eq, PartialOrd, Ord
|
||||
at Clone, Copy
|
||||
at Debug
|
||||
at Clone
|
||||
at Hash
|
||||
at PartialOrd
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -157,16 +158,15 @@ pub macro Ord {}
|
|||
check(
|
||||
r#"#[derive($0 serde::Serialize, PartialEq)] struct Test;"#,
|
||||
expect![[r#"
|
||||
at PartialEq
|
||||
at Default
|
||||
at Eq
|
||||
at Eq, PartialOrd, Ord
|
||||
at Clone, Copy
|
||||
at Debug
|
||||
at Clone
|
||||
at Hash
|
||||
at PartialOrd
|
||||
"#]],
|
||||
at Default
|
||||
at Eq
|
||||
at Eq, PartialOrd, Ord
|
||||
at Clone, Copy
|
||||
at Debug
|
||||
at Clone
|
||||
at Hash
|
||||
at PartialOrd
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue