aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-05 07:41:09 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-05 07:41:09 +0100
commit3be2d1db6c04a99efdd32b1af724caeb10d9676b (patch)
treeeb325b0b466a9267755c3e457727f63d86c65257 /crates/ra_ide_api
parent21f70a7293e7b24dedeec9a504763a1a3ef57675 (diff)
parentd0e9cd2bc655f13392c6687afa72e4dca706abbe (diff)
Merge #1492
1492: Fix clippy::redundant_clone r=matklad a=sinkuu Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/hover.rs2
-rw-r--r--crates/ra_ide_api/src/mock_analysis.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 1edeb7579..48f1f49c9 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -88,7 +88,7 @@ impl HoverResult {
88fn hover_text(docs: Option<String>, desc: Option<String>) -> Option<String> { 88fn hover_text(docs: Option<String>, desc: Option<String>) -> Option<String> {
89 match (desc, docs) { 89 match (desc, docs) {
90 (Some(desc), docs) => Some(rust_code_markup_with_doc(desc, docs)), 90 (Some(desc), docs) => Some(rust_code_markup_with_doc(desc, docs)),
91 (None, Some(docs)) => Some(docs.to_string()), 91 (None, Some(docs)) => Some(docs),
92 _ => None, 92 _ => None,
93 } 93 }
94} 94}
diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs
index 4dbbd489a..132f6f875 100644
--- a/crates/ra_ide_api/src/mock_analysis.rs
+++ b/crates/ra_ide_api/src/mock_analysis.rs
@@ -62,13 +62,13 @@ impl MockAnalysis {
62 pub fn add_file_with_position(&mut self, path: &str, text: &str) -> FilePosition { 62 pub fn add_file_with_position(&mut self, path: &str, text: &str) -> FilePosition {
63 let (offset, text) = extract_offset(text); 63 let (offset, text) = extract_offset(text);
64 let file_id = FileId((self.files.len() + 1) as u32); 64 let file_id = FileId((self.files.len() + 1) as u32);
65 self.files.push((path.to_string(), text.to_string())); 65 self.files.push((path.to_string(), text));
66 FilePosition { file_id, offset } 66 FilePosition { file_id, offset }
67 } 67 }
68 pub fn add_file_with_range(&mut self, path: &str, text: &str) -> FileRange { 68 pub fn add_file_with_range(&mut self, path: &str, text: &str) -> FileRange {
69 let (range, text) = extract_range(text); 69 let (range, text) = extract_range(text);
70 let file_id = FileId((self.files.len() + 1) as u32); 70 let file_id = FileId((self.files.len() + 1) as u32);
71 self.files.push((path.to_string(), text.to_string())); 71 self.files.push((path.to_string(), text));
72 FileRange { file_id, range } 72 FileRange { file_id, range }
73 } 73 }
74 pub fn id_of(&self, path: &str) -> FileId { 74 pub fn id_of(&self, path: &str) -> FileId {