Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3b18238

Browse files
committed
simplify function to create a string from the itemized block
1 parent ab7f4e1 commit 3b18238

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/comment.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,7 @@ impl ItemizedBlock {
481481

482482
/// Returns the block as a string under its original form
483483
fn original_block_as_string(&self) -> String {
484-
self.lines
485-
.iter()
486-
.map(|line| format!("{}\n", line))
487-
.collect::<String>()
484+
self.lines.join("\n")
488485
}
489486
}
490487

tests/target/issue-3224.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// rustfmt-wrap_comments: true
2+
3+
//! Test:
4+
//! * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5+
//! * [`examples/simple`] – Demonstrates use of the [`init`] API with plain
6+
//! structs.
7+
//! * [`examples/simple_flatbuffer`] – Demonstrates use of the [`init`] API with
8+
//! FlatBuffers.
9+
//! * [`examples/gravity`] – Demonstrates use of the [`RLBot::set_game_state`]
10+
//! API
11+
fn foo() {}

0 commit comments

Comments
 (0)