From 13b4bb12ad6ef84dea53c5a2547473b3d4ab93e3 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Thu, 2 Nov 2023 19:23:36 +0000 Subject: Clean up after if chain removal --- clippy_lints/src/inconsistent_struct_constructor.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'clippy_lints/src/inconsistent_struct_constructor.rs') diff --git a/clippy_lints/src/inconsistent_struct_constructor.rs b/clippy_lints/src/inconsistent_struct_constructor.rs index 14842800b57..f6e1281a291 100644 --- a/clippy_lints/src/inconsistent_struct_constructor.rs +++ b/clippy_lints/src/inconsistent_struct_constructor.rs @@ -1,6 +1,5 @@ use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::source::snippet; -use if_chain::if_chain; use rustc_data_structures::fx::FxHashMap; use rustc_errors::Applicability; use rustc_hir::{self as hir, ExprKind}; @@ -94,14 +93,15 @@ impl<'tcx> LateLintPass<'tcx> for InconsistentStructConstructor { fields_snippet.push_str(&last_ident.to_string()); let base_snippet = if let Some(base) = base { - format!(", ..{}", snippet(cx, base.span, "..")) - } else { - String::new() - }; + format!(", ..{}", snippet(cx, base.span, "..")) + } else { + String::new() + }; - let sugg = format!("{} {{ {fields_snippet}{base_snippet} }}", + let sugg = format!( + "{} {{ {fields_snippet}{base_snippet} }}", snippet(cx, qpath.span(), ".."), - ); + ); span_lint_and_sugg( cx, @@ -111,7 +111,7 @@ impl<'tcx> LateLintPass<'tcx> for InconsistentStructConstructor { "try", sugg, Applicability::MachineApplicable, - ) + ); } } } -- cgit 1.4.1-3-g733a5