many-to-one 6/9: Implement ruff_macros::map_codes

This commit is contained in:
Martin Fischer 2023-02-03 03:18:30 +01:00 committed by Charlie Marsh
parent 9eda286dcd
commit c314e10e54
19 changed files with 505 additions and 271 deletions

View file

@ -37,7 +37,7 @@ pub fn linter(format: HelpFormat) -> Result<()> {
.upstream_categories()
.unwrap()
.iter()
.map(|UpstreamCategory(prefix, ..)| prefix.as_ref())
.map(|UpstreamCategory(prefix, ..)| prefix.short_code())
.join("/"),
prefix => prefix.to_string(),
};
@ -52,8 +52,8 @@ pub fn linter(format: HelpFormat) -> Result<()> {
name: linter_info.name(),
categories: linter_info.upstream_categories().map(|cats| {
cats.iter()
.map(|UpstreamCategory(prefix, name, ..)| LinterCategoryInfo {
prefix: prefix.as_ref(),
.map(|UpstreamCategory(prefix, name)| LinterCategoryInfo {
prefix: prefix.short_code(),
name,
})
.collect()
@ -74,7 +74,7 @@ pub fn linter(format: HelpFormat) -> Result<()> {
.upstream_categories()
.unwrap()
.iter()
.map(|UpstreamCategory(prefix, ..)| prefix.as_ref())
.map(|UpstreamCategory(prefix, ..)| prefix.short_code())
.join("/"),
prefix => prefix.to_string(),
};