Plurals in format redundant arguments suggestion

This commit is contained in:
francorbacho 2023-10-05 14:32:56 +02:00
parent 4a7a98cf30
commit fcdd5c0b2d
2 changed files with 6 additions and 3 deletions

View File

@ -139,7 +139,10 @@ builtin_macros_format_positional_after_named = positional arguments cannot follo
builtin_macros_format_remove_raw_ident = remove the `r#`
builtin_macros_format_redundant_args = redundant argument
builtin_macros_format_redundant_args = redundant {$n ->
[one] argument
*[more] arguments
}
.help = {$n ->
[one] the formatting string already captures the binding directly, it doesn't need to be included in the argument list
*[more] the formatting strings already captures the bindings directly, they don't need to be included in the argument list

View File

@ -34,7 +34,7 @@ note: the formatting specifier is referencing the binding already
LL | println!("{} {x}", x, x);
| ^
error: redundant argument
error: redundant arguments
--> $DIR/issue-105225.rs:13:14
|
LL | println!("{x} {y}", x, y);
@ -51,7 +51,7 @@ LL - println!("{x} {y}", x, y);
LL + println!("{x} {y}", );
|
error: redundant argument
error: redundant arguments
--> $DIR/issue-105225.rs:17:14
|
LL | println!("{} {} {x} {y} {}", x, x, x, y, y);