Skip to content

Commit b3d07f7

Browse files
committed
fix(lints): plural form correctly
1 parent 7b1bc3d commit b3d07f7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/cargo/core/workspace.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,8 @@ impl<'gctx> Workspace<'gctx> {
12991299
}
13001300

13011301
if error_count > 0 {
1302-
bail!("encountered {error_count} errors(s) while running lints")
1302+
let plural = if error_count == 1 { "" } else { "s" };
1303+
bail!("encountered {error_count} error{plural} while running lints")
13031304
} else {
13041305
Ok(())
13051306
}

tests/testsuite/lints/error/stderr.term.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/testsuite/lints/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test_dummy_unstable = { level = "forbid", priority = -1 }
8383
| ^^^^^^^^^^^^^^^^^^
8484
|
8585
= [NOTE] `cargo::im_a_teapot` is set to `forbid` in `[lints]`
86-
[ERROR] encountered 1 errors(s) while running lints
86+
[ERROR] encountered 1 error while running lints
8787
8888
"#]])
8989
.run();
@@ -126,7 +126,7 @@ workspace = true
126126
| ^^^^^^^^^^^^^^^^^^
127127
|
128128
= [NOTE] `cargo::im_a_teapot` is set to `forbid` in `[lints]`
129-
[ERROR] encountered 1 errors(s) while running lints
129+
[ERROR] encountered 1 error while running lints
130130
131131
"#]])
132132
.run();

0 commit comments

Comments
 (0)