refactor: Add Copy implementation to Rule (#3556)

This commit is contained in:
Micha Reiser 2023-03-16 17:50:18 +01:00 committed by GitHub
parent aa51ecedc5
commit eff84442bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 835 additions and 965 deletions

View file

@ -167,7 +167,7 @@ pub fn map_codes(func: &ItemFn) -> syn::Result<TokenStream> {
});
#[allow(clippy::type_complexity)]
let mut rule_to_codes: HashMap<&Path, Vec<(&Ident, &String, &Vec<Attribute>)>> = HashMap::new();
let mut rule_to_codes: HashMap<&Path, Vec<(&Ident, &str, &Vec<Attribute>)>> = HashMap::new();
let mut linter_code_for_rule_match_arms = quote!();
for (linter, map) in &linters {
@ -227,7 +227,7 @@ pub fn map_codes(func: &ItemFn) -> syn::Result<TokenStream> {
}
impl crate::registry::Linter {
pub fn code_for_rule(&self, rule: &Rule) -> Option<&'static str> {
pub fn code_for_rule(&self, rule: Rule) -> Option<&'static str> {
match (self, rule) {
#linter_code_for_rule_match_arms
_ => None,