diff options
| author | Philipp Krones <hello@philkrones.com> | 2024-09-24 11:58:04 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2024-09-24 11:58:04 +0200 |
| commit | b61fcbee76f8e862c1de7523058e7e8a8b4ed4ef (patch) | |
| tree | 94c8da0e70fdde0f678142ebab95e1f55290e74a /clippy_lints/src/same_name_method.rs | |
| parent | 249210e8d86a4de347def1be559dfa79d346cb9f (diff) | |
| download | rust-b61fcbee76f8e862c1de7523058e7e8a8b4ed4ef.tar.gz rust-b61fcbee76f8e862c1de7523058e7e8a8b4ed4ef.zip | |
Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update
Diffstat (limited to 'clippy_lints/src/same_name_method.rs')
| -rw-r--r-- | clippy_lints/src/same_name_method.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clippy_lints/src/same_name_method.rs b/clippy_lints/src/same_name_method.rs index 508f3ae6def..8d31641d483 100644 --- a/clippy_lints/src/same_name_method.rs +++ b/clippy_lints/src/same_name_method.rs @@ -5,8 +5,8 @@ use rustc_hir::{HirId, Impl, ItemKind, Node, Path, QPath, TraitRef, TyKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::AssocKind; use rustc_session::declare_lint_pass; -use rustc_span::symbol::Symbol; use rustc_span::Span; +use rustc_span::symbol::Symbol; use std::collections::{BTreeMap, BTreeSet}; declare_clippy_lint! { @@ -62,13 +62,10 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod { && let TyKind::Path(QPath::Resolved(_, Path { res, .. })) = self_ty.kind { if !map.contains_key(res) { - map.insert( - *res, - ExistingName { - impl_methods: BTreeMap::new(), - trait_methods: BTreeMap::new(), - }, - ); + map.insert(*res, ExistingName { + impl_methods: BTreeMap::new(), + trait_methods: BTreeMap::new(), + }); } let existing_name = map.get_mut(res).unwrap(); |
