diff options
| author | bors <bors@rust-lang.org> | 2023-12-19 06:49:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-19 06:49:22 +0000 |
| commit | f1d09c9c7c4a27c7f5b1aa177428493d147c5e6f (patch) | |
| tree | fa15bc9fc2e28efed2f31f220f7717fbbf5f2e85 | |
| parent | 0ed815faca2c408803cb2724c288ca8a2094e58b (diff) | |
| parent | 9f4d26901ba98f2d387bce5dd7fad55ce1a36b81 (diff) | |
| download | rust-f1d09c9c7c4a27c7f5b1aa177428493d147c5e6f.tar.gz rust-f1d09c9c7c4a27c7f5b1aa177428493d147c5e6f.zip | |
Auto merge of #16159 - Waqar144:work/simplify, r=Veykril
minor: use a single push_str instead of 2 push
| -rw-r--r-- | crates/ide/src/markdown_remove.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ide/src/markdown_remove.rs b/crates/ide/src/markdown_remove.rs index 718868c8747..ae3f2fabf02 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(_) |
