diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir/src/docs.rs | 6 | ||||
-rw-r--r-- | 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<String> for Documentation { | |||
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
25 | impl<'a> Into<String> for &'a Documentation { | ||
26 | fn into(self) -> String { | ||
27 | self.contents().into() | ||
28 | } | ||
29 | } | ||
30 | |||
31 | pub trait Docs { | 25 | pub trait Docs { |
32 | fn docs(&self, db: &impl HirDatabase) -> Option<Documentation>; | 26 | fn docs(&self, db: &impl HirDatabase) -> Option<Documentation>; |
33 | } | 27 | } |
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 { | |||
118 | fn parameters(&self) -> &[String] { | 118 | fn parameters(&self) -> &[String] { |
119 | &self.signature.parameters | 119 | &self.signature.parameters |
120 | } | 120 | } |
121 | |||
122 | #[cfg(test)] | ||
123 | fn doc(&self) -> Option<&hir::Documentation> { | ||
124 | self.signature.doc.as_ref() | ||
125 | } | ||
126 | |||
127 | #[cfg(test)] | ||
128 | fn label(&self) -> String { | ||
129 | self.signature.to_string() | ||
130 | } | ||
131 | } | 121 | } |
132 | 122 | ||
133 | #[cfg(test)] | 123 | #[cfg(test)] |
@@ -138,6 +128,17 @@ mod tests { | |||
138 | 128 | ||
139 | use super::*; | 129 | use super::*; |
140 | 130 | ||
131 | // These are only used when testing | ||
132 | impl CallInfo { | ||
133 | fn doc(&self) -> Option<hir::Documentation> { | ||
134 | self.signature.doc.clone() | ||
135 | } | ||
136 | |||
137 | fn label(&self) -> String { | ||
138 | self.signature.to_string() | ||
139 | } | ||
140 | } | ||
141 | |||
141 | fn call_info(text: &str) -> CallInfo { | 142 | fn call_info(text: &str) -> CallInfo { |
142 | let (analysis, position) = single_file_with_position(text); | 143 | let (analysis, position) = single_file_with_position(text); |
143 | analysis.call_info(position).unwrap().unwrap() | 144 | analysis.call_info(position).unwrap().unwrap() |