about summary refs log tree commit diff
path: root/clippy_lints/src/implicit_hasher.rs
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2022-10-06 09:44:38 +0200
committerPhilipp Krones <hello@philkrones.com>2022-10-06 09:44:38 +0200
commitd75b25faabdcf0a22fe37928917c4ab1761fa265 (patch)
treee8c46d2dae51a0a61a6d28de138ca9add8276d8d /clippy_lints/src/implicit_hasher.rs
parentda16cc1da9814710e637ff242b71768a4d3724b7 (diff)
downloadrust-d75b25faabdcf0a22fe37928917c4ab1761fa265.tar.gz
rust-d75b25faabdcf0a22fe37928917c4ab1761fa265.zip
Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyup
Diffstat (limited to 'clippy_lints/src/implicit_hasher.rs')
-rw-r--r--clippy_lints/src/implicit_hasher.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/clippy_lints/src/implicit_hasher.rs b/clippy_lints/src/implicit_hasher.rs
index a920c3bba2a..93efe957b1d 100644
--- a/clippy_lints/src/implicit_hasher.rs
+++ b/clippy_lints/src/implicit_hasher.rs
@@ -5,6 +5,7 @@ use rustc_errors::Diagnostic;
 use rustc_hir as hir;
 use rustc_hir::intravisit::{walk_body, walk_expr, walk_inf, walk_ty, Visitor};
 use rustc_hir::{Body, Expr, ExprKind, GenericArg, Item, ItemKind, QPath, TyKind};
+use rustc_hir_analysis::hir_ty_to_ty;
 use rustc_lint::{LateContext, LateLintPass, LintContext};
 use rustc_middle::hir::nested_filter;
 use rustc_middle::lint::in_external_macro;
@@ -12,7 +13,6 @@ use rustc_middle::ty::{Ty, TypeckResults};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::source_map::Span;
 use rustc_span::symbol::sym;
-use rustc_hir_analysis::hir_ty_to_ty;
 
 use if_chain::if_chain;
 
@@ -89,8 +89,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitHasher {
                     (
                         generics_suggestion_span,
                         format!(
-                            "<{}{}S: ::std::hash::BuildHasher{}>",
-                            generics_snip,
+                            "<{generics_snip}{}S: ::std::hash::BuildHasher{}>",
                             if generics_snip.is_empty() { "" } else { ", " },
                             if vis.suggestions.is_empty() {
                                 ""
@@ -263,8 +262,8 @@ impl<'tcx> ImplicitHasherType<'tcx> {
 
     fn type_arguments(&self) -> String {
         match *self {
-            ImplicitHasherType::HashMap(.., ref k, ref v) => format!("{}, {}", k, v),
-            ImplicitHasherType::HashSet(.., ref t) => format!("{}", t),
+            ImplicitHasherType::HashMap(.., ref k, ref v) => format!("{k}, {v}"),
+            ImplicitHasherType::HashSet(.., ref t) => format!("{t}"),
         }
     }