diff options
author | Shotaro Yamada <[email protected]> | 2019-07-05 04:41:53 +0100 |
---|---|---|
committer | Shotaro Yamada <[email protected]> | 2019-07-05 04:45:58 +0100 |
commit | d0e9cd2bc655f13392c6687afa72e4dca706abbe (patch) | |
tree | eb325b0b466a9267755c3e457727f63d86c65257 /crates/ra_ide_api | |
parent | 21f70a7293e7b24dedeec9a504763a1a3ef57675 (diff) |
Fix clippy::redundant_clone
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/mock_analysis.rs | 4 |
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 { | |||
88 | fn hover_text(docs: Option<String>, desc: Option<String>) -> Option<String> { | 88 | fn 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 { |