Skip to content

Commit a594f32

Browse files
committed
fix(lints): plural form correctly
1 parent 12aa62c commit a594f32

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/cargo/core/workspace.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,10 +1348,8 @@ impl<'gctx> Workspace<'gctx> {
13481348
}
13491349

13501350
if error_count > 0 {
1351-
Err(crate::util::errors::AlreadyPrintedError::new(anyhow!(
1352-
"encountered {error_count} errors(s) while running lints"
1353-
))
1354-
.into())
1351+
let plural = if error_count == 1 { "" } else { "s" };
1352+
bail!("encountered {error_count} error{plural} while running lints")
13551353
} else {
13561354
Ok(())
13571355
}

tests/testsuite/lints/blanket_hint_mostly_unused.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ blanket_hint_mostly_unused = "deny"
203203
|
204204
7 | [profile.dev.package.<pkg_name>]
205205
| +++++++++++++++++++
206+
[ERROR] encountered 1 error while running lints
206207
207208
"#]])
208209
.run();

0 commit comments

Comments
 (0)