diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 79ed303882..9b48049064 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -93,9 +93,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option Option for String { } } +impl From for Markup { + fn from(text: String) -> Self { + Markup { text } + } +} + impl fmt::Display for Markup { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Display::fmt(&self.text, f) @@ -26,13 +32,4 @@ impl Markup { pub fn as_str(&self) -> &str { self.text.as_str() } - pub fn is_empty(&self) -> bool { - self.text.is_empty() - } - pub fn push_section(&mut self, section: &str) { - if !self.text.is_empty() { - self.text.push_str("\n\n___\n"); - } - self.text.push_str(section); - } }