fix(lints): plural form correctly

This commit is contained in:
Weihang Lo
2025-12-02 00:03:35 -05:00
parent 12aa62cab1
commit a594f32cdc
2 changed files with 3 additions and 4 deletions

View File

@@ -1348,10 +1348,8 @@ impl<'gctx> Workspace<'gctx> {
}
if error_count > 0 {
Err(crate::util::errors::AlreadyPrintedError::new(anyhow!(
"encountered {error_count} errors(s) while running lints"
))
.into())
let plural = if error_count == 1 { "" } else { "s" };
bail!("encountered {error_count} error{plural} while running lints")
} else {
Ok(())
}

View File

@@ -203,6 +203,7 @@ blanket_hint_mostly_unused = "deny"
|
7 | [profile.dev.package.<pkg_name>]
| +++++++++++++++++++
[ERROR] encountered 1 error while running lints
"#]])
.run();