From 966c23f5290275ce17564f6027a17ec20cd6078f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 17 Mar 2021 01:27:56 +0100 Subject: avoid converting types into themselves via .into() (clippy::useless-conversion) example: let x: String = String::from("hello world").into(); --- crates/ide_db/src/defs.rs | 2 +- crates/ide_db/src/helpers/insert_use.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_db/src') diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index f86e5ce93..75167ff39 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs @@ -181,7 +181,7 @@ impl NameClass { }, ast::SelfParam(it) => { let def = sema.to_def(&it)?; - Some(NameClass::Definition(Definition::Local(def.into()))) + Some(NameClass::Definition(Definition::Local(def))) }, ast::RecordField(it) => { let field: hir::Field = sema.to_def(&it)?; diff --git a/crates/ide_db/src/helpers/insert_use.rs b/crates/ide_db/src/helpers/insert_use.rs index df66d8ea0..9e0cb91c3 100644 --- a/crates/ide_db/src/helpers/insert_use.rs +++ b/crates/ide_db/src/helpers/insert_use.rs @@ -80,7 +80,7 @@ impl ImportScope { }) .last() .map(|last_inner_element| { - (InsertPosition::After(last_inner_element.into()), AddBlankLine::BeforeTwice) + (InsertPosition::After(last_inner_element), AddBlankLine::BeforeTwice) }) .unwrap_or_else(|| self.first_insert_pos()) } -- cgit v1.2.3