mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
refactor: Add Copy implementation to Rule (#3556)
This commit is contained in:
parent
aa51ecedc5
commit
eff84442bc
59 changed files with 835 additions and 965 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue