From 6cc6dee9e96d55dbbd8593523551a9981a691147 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:25:55 +0530 Subject: clippy::useless_conversion --- crates/hir_def/src/item_tree/pretty.rs | 2 +- crates/hir_def/src/lib.rs | 9 +++------ crates/hir_def/src/test_db.rs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/item_tree/pretty.rs b/crates/hir_def/src/item_tree/pretty.rs index cc9944a22..b1e1b70d0 100644 --- a/crates/hir_def/src/item_tree/pretty.rs +++ b/crates/hir_def/src/item_tree/pretty.rs @@ -426,7 +426,7 @@ impl<'a> Printer<'a> { w!(self, " {{"); self.indented(|this| { for item in &**items { - this.print_mod_item((*item).into()); + this.print_mod_item(*item); } }); wln!(self, "}}"); diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index 987485acc..3e7d496d5 100644 --- a/crates/hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs @@ -736,8 +736,7 @@ fn macro_call_as_call_id( db.upcast(), krate, MacroCallKind::FnLike { ast_id: call.ast_id, fragment }, - ) - .into()) + )) }; Ok(res) } @@ -765,8 +764,7 @@ fn derive_macro_as_call_id( derive_name: last_segment.to_string(), derive_attr_index: derive_attr.ast_index, }, - ) - .into(); + ); Ok(res) } @@ -804,7 +802,6 @@ fn attr_macro_as_call_id( attr_args: arg, invoc_attr_index: macro_attr.id.ast_index, }, - ) - .into(); + ); Ok(res) } diff --git a/crates/hir_def/src/test_db.rs b/crates/hir_def/src/test_db.rs index b20b066e2..a16203fdb 100644 --- a/crates/hir_def/src/test_db.rs +++ b/crates/hir_def/src/test_db.rs @@ -325,7 +325,7 @@ impl TestDB { for diag in source_map.diagnostics() { let (ptr, message): (InFile, &str) = match diag { BodyDiagnostic::InactiveCode { node, .. } => { - (node.clone().map(|it| it.into()), "InactiveCode") + (node.clone().map(|it| it), "InactiveCode") } BodyDiagnostic::MacroError { node, message } => { (node.clone().map(|it| it.into()), message.as_str()) -- cgit v1.2.3