From 9f4d26901ba98f2d387bce5dd7fad55ce1a36b81 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Tue, 19 Dec 2023 11:17:09 +0500 Subject: [PATCH] minor: use a single push_str instead of 2 push --- crates/ide/src/markdown_remove.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/ide/src/markdown_remove.rs b/crates/ide/src/markdown_remove.rs index 718868c874..ae3f2fabf0 100644 --- a/crates/ide/src/markdown_remove.rs +++ b/crates/ide/src/markdown_remove.rs @@ -13,10 +13,7 @@ pub(crate) fn remove_markdown(markdown: &str) -> String { Event::Text(text) | Event::Code(text) => out.push_str(&text), Event::SoftBreak => out.push(' '), Event::HardBreak | Event::Rule | Event::End(Tag::CodeBlock(_)) => out.push('\n'), - Event::End(Tag::Paragraph) => { - out.push('\n'); - out.push('\n'); - } + Event::End(Tag::Paragraph) => out.push_str("\n\n"), Event::Start(_) | Event::End(_) | Event::Html(_)