diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-13 08:18:49 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-13 08:18:49 +0100 |
commit | adbee621a75f47e0da4f30d7205dfce009138865 (patch) | |
tree | ed8dcbba37de566f00d119817e141bb8293ce164 /crates/ide_assists/src/handlers/convert_comment_block.rs | |
parent | f107b0f1e223dba33cb9850ce44bcbb4345eef52 (diff) | |
parent | 5ac6804bb3a07b959e8c2c3534255a8d6bb4948c (diff) |
Merge #9242
9242: Clippy r=matklad a=Maan2003
Best viewed commit wise
Co-authored-by: Maan2003 <[email protected]>
Diffstat (limited to 'crates/ide_assists/src/handlers/convert_comment_block.rs')
-rw-r--r-- | crates/ide_assists/src/handlers/convert_comment_block.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_assists/src/handlers/convert_comment_block.rs b/crates/ide_assists/src/handlers/convert_comment_block.rs index d202a85f9..749e8685b 100644 --- a/crates/ide_assists/src/handlers/convert_comment_block.rs +++ b/crates/ide_assists/src/handlers/convert_comment_block.rs | |||
@@ -88,7 +88,7 @@ fn line_to_block(acc: &mut Assists, comment: ast::Comment) -> Option<()> { | |||
88 | // We pick a single indentation level for the whole block comment based on the | 88 | // We pick a single indentation level for the whole block comment based on the |
89 | // comment where the assist was invoked. This will be prepended to the | 89 | // comment where the assist was invoked. This will be prepended to the |
90 | // contents of each line comment when they're put into the block comment. | 90 | // contents of each line comment when they're put into the block comment. |
91 | let indentation = IndentLevel::from_token(&comment.syntax()); | 91 | let indentation = IndentLevel::from_token(comment.syntax()); |
92 | 92 | ||
93 | let block_comment_body = | 93 | let block_comment_body = |
94 | comments.into_iter().map(|c| line_comment_text(indentation, c)).join("\n"); | 94 | comments.into_iter().map(|c| line_comment_text(indentation, c)).join("\n"); |
@@ -167,7 +167,7 @@ fn line_comment_text(indentation: IndentLevel, comm: ast::Comment) -> String { | |||
167 | if contents.is_empty() { | 167 | if contents.is_empty() { |
168 | contents.to_owned() | 168 | contents.to_owned() |
169 | } else { | 169 | } else { |
170 | indentation.to_string() + &contents | 170 | indentation.to_string() + contents |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||