many-to-one 2/9: Newtype Rule::noqa_code return type

Rule::noqa_code previously return a single &'static str,
which was possible because we had one enum listing all
rule code prefixes. This commit series will however split up
the RuleCodePrefix enum into several enums ... so we'll end up
with two &'static str ... this commit wraps the return type
of Rule::noqa_code into a newtype so that we can easily change
it to return two &'static str in the 6th commit of this series.
This commit is contained in:
Martin Fischer 2023-01-31 17:52:44 +01:00 committed by Charlie Marsh
parent d451c7a506
commit 179ead0157
8 changed files with 64 additions and 37 deletions

View file

@ -25,7 +25,7 @@ pub fn main(args: &Args) -> Result<()> {
output.push('\n');
output.push('\n');
let (linter, _) = Linter::parse_code(rule.noqa_code()).unwrap();
let (linter, _) = Linter::parse_code(&rule.noqa_code().to_string()).unwrap();
output.push_str(&format!("Derived from the **{}** linter.", linter.name()));
output.push('\n');
output.push('\n');