minor: use a single push_str instead of 2 push

This commit is contained in:
Waqar Ahmed 2023-12-19 11:17:09 +05:00
parent 0ed815faca
commit 9f4d26901b

View File

@ -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(_)