From 84fde47d00bb3ccba3876ad2b2e46c5c59cd07c4 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Thu, 4 Apr 2019 18:06:22 +0300 Subject: Move test specific things --- crates/ra_hir/src/docs.rs | 6 ------ crates/ra_ide_api/src/call_info.rs | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/crates/ra_hir/src/docs.rs b/crates/ra_hir/src/docs.rs index e3a755b46..5db72c08a 100644 --- a/crates/ra_hir/src/docs.rs +++ b/crates/ra_hir/src/docs.rs @@ -22,12 +22,6 @@ impl Into for Documentation { } } -impl<'a> Into for &'a Documentation { - fn into(self) -> String { - self.contents().into() - } -} - pub trait Docs { fn docs(&self, db: &impl HirDatabase) -> Option; } diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs index a65119315..3c53bd11a 100644 --- a/crates/ra_ide_api/src/call_info.rs +++ b/crates/ra_ide_api/src/call_info.rs @@ -118,16 +118,6 @@ impl CallInfo { fn parameters(&self) -> &[String] { &self.signature.parameters } - - #[cfg(test)] - fn doc(&self) -> Option<&hir::Documentation> { - self.signature.doc.as_ref() - } - - #[cfg(test)] - fn label(&self) -> String { - self.signature.to_string() - } } #[cfg(test)] @@ -138,6 +128,17 @@ mod tests { use super::*; + // These are only used when testing + impl CallInfo { + fn doc(&self) -> Option { + self.signature.doc.clone() + } + + fn label(&self) -> String { + self.signature.to_string() + } + } + fn call_info(text: &str) -> CallInfo { let (analysis, position) = single_file_with_position(text); analysis.call_info(position).unwrap().unwrap() -- cgit v1.2.3