Suggest space separated format str literal

This commit is contained in:
Esteban Küber 2018-07-21 12:16:06 -07:00
parent 8b59fbc951
commit 83a8af50bb
2 changed files with 3 additions and 3 deletions

View File

@ -728,7 +728,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt,
Err(mut err) => {
let sugg_fmt = match args.len() {
0 => "{}".to_string(),
_ => format!("{}{{}}", "{}, ".repeat(args.len())),
_ => format!("{}{{}}", "{} ".repeat(args.len())),
};
err.span_suggestion(

View File

@ -15,8 +15,8 @@ LL | println!(3, 4);
| ^
help: you might be missing a string literal to format with
|
LL | println!("{}, {}", 3, 4);
| ^^^^^^^^^
LL | println!("{} {}", 3, 4);
| ^^^^^^^^
error: aborting due to 2 previous errors