about summary refs log tree commit diff
path: root/clippy_lints/src/inconsistent_struct_constructor.rs
diff options
context:
space:
mode:
authorYuri Astrakhan <YuriAstrakhan@gmail.com>2022-09-23 13:42:59 -0400
committerYuri Astrakhan <YuriAstrakhan@gmail.com>2022-09-23 13:42:59 -0400
commite67b2bf732876eeb26e0d2fbc4b6c55e1a9f9317 (patch)
tree31ace4c422c55a2e52e4c9daaa8df276a341dfd2 /clippy_lints/src/inconsistent_struct_constructor.rs
parentff65eec80194143a52b3433ff3b98437e130b75d (diff)
downloadrust-e67b2bf732876eeb26e0d2fbc4b6c55e1a9f9317.tar.gz
rust-e67b2bf732876eeb26e0d2fbc4b6c55e1a9f9317.zip
Apply uninlined_format-args to clippy_lints
This change is needed for the uninlined_format-args lint to be merged.
See https://github.com/rust-lang/rust-clippy/pull/9233
Diffstat (limited to 'clippy_lints/src/inconsistent_struct_constructor.rs')
-rw-r--r--clippy_lints/src/inconsistent_struct_constructor.rs6
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(