diff options
| author | Philipp Krones <hello@philkrones.com> | 2022-10-06 09:19:29 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2022-10-06 09:19:29 +0200 |
| commit | e2808afd60ea0f0e17c3aced354adfd58a1f825f (patch) | |
| tree | 3d9bcb2d75f4de029f4720c7c5462cd7e09fcf0d /clippy_lints/src/inconsistent_struct_constructor.rs | |
| parent | da16cc1da9814710e637ff242b71768a4d3724b7 (diff) | |
| parent | 887ba0c5a489e28b55ff84244e1dc153861d16ad (diff) | |
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'clippy_lints/src/inconsistent_struct_constructor.rs')
| -rw-r--r-- | clippy_lints/src/inconsistent_struct_constructor.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clippy_lints/src/inconsistent_struct_constructor.rs b/clippy_lints/src/inconsistent_struct_constructor.rs index 14b22d2b50d..e2f2d3d42e6 100644 --- a/clippy_lints/src/inconsistent_struct_constructor.rs +++ b/clippy_lints/src/inconsistent_struct_constructor.rs @@ -90,7 +90,7 @@ impl<'tcx> LateLintPass<'tcx> for InconsistentStructConstructor { let mut fields_snippet = String::new(); let (last_ident, idents) = ordered_fields.split_last().unwrap(); for ident in idents { - let _ = write!(fields_snippet, "{}, ", ident); + let _ = write!(fields_snippet, "{ident}, "); } fields_snippet.push_str(&last_ident.to_string()); @@ -100,10 +100,8 @@ impl<'tcx> LateLintPass<'tcx> for InconsistentStructConstructor { String::new() }; - let sugg = format!("{} {{ {}{} }}", + let sugg = format!("{} {{ {fields_snippet}{base_snippet} }}", snippet(cx, qpath.span(), ".."), - fields_snippet, - base_snippet, ); span_lint_and_sugg( |
