From 1b0c7701cc97cd7bef8bb9729011d4cf291a60c5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 17:42:52 +0200 Subject: Rename ra_ide -> ide --- crates/ra_ide/src/markup.rs | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 crates/ra_ide/src/markup.rs (limited to 'crates/ra_ide/src/markup.rs') diff --git a/crates/ra_ide/src/markup.rs b/crates/ra_ide/src/markup.rs deleted file mode 100644 index 60c193c40..000000000 --- a/crates/ra_ide/src/markup.rs +++ /dev/null @@ -1,38 +0,0 @@ -//! Markdown formatting. -//! -//! Sometimes, we want to display a "rich text" in the UI. At the moment, we use -//! markdown for this purpose. It doesn't feel like a right option, but that's -//! what is used by LSP, so let's keep it simple. -use std::fmt; - -#[derive(Default, Debug)] -pub struct Markup { - text: String, -} - -impl From for String { - fn from(markup: Markup) -> Self { - markup.text - } -} - -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) - } -} - -impl Markup { - pub fn as_str(&self) -> &str { - self.text.as_str() - } - pub fn fenced_block(contents: &impl fmt::Display) -> Markup { - format!("```rust\n{}\n```", contents).into() - } -} -- cgit v1.2.3