aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorMaan2003 <[email protected]>2021-06-13 04:57:19 +0100
committerMaan2003 <[email protected]>2021-06-13 04:57:19 +0100
commit705f7e6e2644bf5de4255bc05ea8d9d5027c29b0 (patch)
tree1bf26189989bb871a86ec4ee612c978be5e5f883 /crates/ide/src
parent6cc6dee9e96d55dbbd8593523551a9981a691147 (diff)
clippy::clone_on_copy
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/goto_definition.rs2
-rw-r--r--crates/ide/src/goto_implementation.rs2
-rw-r--r--crates/ide/src/hover.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index 27a292d83..d29ee64a5 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -43,7 +43,7 @@ pub(crate) fn goto_definition(
43 let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?; 43 let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?;
44 let (_, link, ns) = 44 let (_, link, ns) =
45 extract_definitions_from_markdown(docs.as_str()).into_iter().find(|(range, ..)| { 45 extract_definitions_from_markdown(docs.as_str()).into_iter().find(|(range, ..)| {
46 doc_mapping.map(range.clone()).map_or(false, |InFile { file_id, value: range }| { 46 doc_mapping.map(*range).map_or(false, |InFile { file_id, value: range }| {
47 file_id == position.file_id.into() && range.contains(position.offset) 47 file_id == position.file_id.into() && range.contains(position.offset)
48 }) 48 })
49 })?; 49 })?;
diff --git a/crates/ide/src/goto_implementation.rs b/crates/ide/src/goto_implementation.rs
index 95fd39850..0013820b4 100644
--- a/crates/ide/src/goto_implementation.rs
+++ b/crates/ide/src/goto_implementation.rs
@@ -87,7 +87,7 @@ fn impls_for_trait_item(
87 .filter_map(|imp| { 87 .filter_map(|imp| {
88 let item = imp.items(sema.db).iter().find_map(|itm| { 88 let item = imp.items(sema.db).iter().find_map(|itm| {
89 let itm_name = itm.name(sema.db)?; 89 let itm_name = itm.name(sema.db)?;
90 (itm_name == fun_name).then(|| itm.clone()) 90 (itm_name == fun_name).then(|| *itm)
91 })?; 91 })?;
92 item.try_to_nav(sema.db) 92 item.try_to_nav(sema.db)
93 }) 93 })
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index b4b3b45b5..4ba4f61d8 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -131,7 +131,7 @@ pub(crate) fn hover(
131 let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?; 131 let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?;
132 let (idl_range, link, ns) = 132 let (idl_range, link, ns) =
133 extract_definitions_from_markdown(docs.as_str()).into_iter().find_map(|(range, link, ns)| { 133 extract_definitions_from_markdown(docs.as_str()).into_iter().find_map(|(range, link, ns)| {
134 let InFile { file_id, value: range } = doc_mapping.map(range.clone())?; 134 let InFile { file_id, value: range } = doc_mapping.map(range)?;
135 if file_id == position.file_id.into() && range.contains(position.offset) { 135 if file_id == position.file_id.into() && range.contains(position.offset) {
136 Some((range, link, ns)) 136 Some((range, link, ns))
137 } else { 137 } else {