We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ItemizedBlock::trimmed_block_as_string
1 parent 40909b4 commit 9d407bfCopy full SHA for 9d407bf
src/comment.rs
@@ -533,10 +533,11 @@ impl ItemizedBlock {
533
534
/// Returns the block as a string, with each line trimmed at the start.
535
fn trimmed_block_as_string(&self) -> String {
536
- self.lines
537
- .iter()
538
- .map(|line| format!("{} ", line.trim_start()))
539
- .collect::<String>()
+ self.lines.iter().fold(String::new(), |mut acc, line| {
+ acc.push_str(line.trim_start());
+ acc.push(' ');
+ acc
540
+ })
541
}
542
543
/// Returns the block as a string under its original form.
0 commit comments