From d0e9cd2bc655f13392c6687afa72e4dca706abbe Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Fri, 5 Jul 2019 12:41:53 +0900 Subject: Fix clippy::redundant_clone --- crates/ra_ide_api/src/hover.rs | 2 +- crates/ra_ide_api/src/mock_analysis.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide_api') 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 { fn hover_text(docs: Option, desc: Option) -> Option { match (desc, docs) { (Some(desc), docs) => Some(rust_code_markup_with_doc(desc, docs)), - (None, Some(docs)) => Some(docs.to_string()), + (None, Some(docs)) => Some(docs), _ => None, } } 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 { pub fn add_file_with_position(&mut self, path: &str, text: &str) -> FilePosition { let (offset, text) = extract_offset(text); let file_id = FileId((self.files.len() + 1) as u32); - self.files.push((path.to_string(), text.to_string())); + self.files.push((path.to_string(), text)); FilePosition { file_id, offset } } pub fn add_file_with_range(&mut self, path: &str, text: &str) -> FileRange { let (range, text) = extract_range(text); let file_id = FileId((self.files.len() + 1) as u32); - self.files.push((path.to_string(), text.to_string())); + self.files.push((path.to_string(), text)); FileRange { file_id, range } } pub fn id_of(&self, path: &str) -> FileId { -- cgit v1.2.3