simplify function to create a string from the itemized block

This commit is contained in:
Stéphane Campinas 2018-12-25 23:15:52 +01:00
parent ab7f4e19eb
commit 3b18238009
No known key found for this signature in database
GPG Key ID: 6D5620D908210133
2 changed files with 12 additions and 4 deletions

View File

@ -481,10 +481,7 @@ impl ItemizedBlock {
/// Returns the block as a string under its original form
fn original_block_as_string(&self) -> String {
self.lines
.iter()
.map(|line| format!("{}\n", line))
.collect::<String>()
self.lines.join("\n")
}
}

View File

@ -0,0 +1,11 @@
// rustfmt-wrap_comments: true
//! Test:
//! * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
//! * [`examples/simple`] Demonstrates use of the [`init`] API with plain
//! structs.
//! * [`examples/simple_flatbuffer`] Demonstrates use of the [`init`] API with
//! FlatBuffers.
//! * [`examples/gravity`] Demonstrates use of the [`RLBot::set_game_state`]
//! API
fn foo() {}