about summary refs log tree commit diff
path: root/clippy_lints/src/inconsistent_struct_constructor.rs
diff options
context:
space:
mode:
authorPeter Jaszkowiak <p.jaszkow@gmail.com>2022-04-03 21:40:58 -0600
committerPeter Jaszkowiak <p.jaszkow@gmail.com>2022-04-13 22:48:36 -0600
commit67badbeef6ce5452cc47f2463d7146048ce64625 (patch)
treee07f33c9177ce0150f5d075812e364eae6258ed6 /clippy_lints/src/inconsistent_struct_constructor.rs
parentb6645d022e492a20da31123f8aff5b5af3eb31c9 (diff)
downloadrust-67badbeef6ce5452cc47f2463d7146048ce64625.tar.gz
rust-67badbeef6ce5452cc47f2463d7146048ce64625.zip
New lint `format_add_strings`
Diffstat (limited to 'clippy_lints/src/inconsistent_struct_constructor.rs')
-rw-r--r--clippy_lints/src/inconsistent_struct_constructor.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/clippy_lints/src/inconsistent_struct_constructor.rs b/clippy_lints/src/inconsistent_struct_constructor.rs
index c8ec2f45137..14b22d2b50d 100644
--- a/clippy_lints/src/inconsistent_struct_constructor.rs
+++ b/clippy_lints/src/inconsistent_struct_constructor.rs
@@ -7,6 +7,7 @@ use rustc_hir::{self as hir, ExprKind};
 use rustc_lint::{LateContext, LateLintPass};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::symbol::Symbol;
+use std::fmt::Write as _;
 
 declare_clippy_lint! {
     /// ### What it does
@@ -89,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 {
-                    fields_snippet.push_str(&format!("{}, ", ident));
+                    let _ = write!(fields_snippet, "{}, ", ident);
                 }
                 fields_snippet.push_str(&last_ident.to_string());