mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-21 12:13:12 +00:00
Move test specific things
This commit is contained in:
parent
751b454442
commit
84fde47d00
@ -22,12 +22,6 @@ impl Into<String> for Documentation {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<String> for &'a Documentation {
|
||||
fn into(self) -> String {
|
||||
self.contents().into()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Docs {
|
||||
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation>;
|
||||
}
|
||||
|
@ -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<hir::Documentation> {
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user