Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/convert_comment_block.rs')
| -rw-r--r-- | crates/ide-assists/src/handlers/convert_comment_block.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ide-assists/src/handlers/convert_comment_block.rs b/crates/ide-assists/src/handlers/convert_comment_block.rs index fbc0b9f673..92b86cee35 100644 --- a/crates/ide-assists/src/handlers/convert_comment_block.rs +++ b/crates/ide-assists/src/handlers/convert_comment_block.rs @@ -1,7 +1,7 @@ use itertools::Itertools; use syntax::{ - ast::{self, edit::IndentLevel, Comment, CommentKind, CommentShape, Whitespace}, AstToken, Direction, SyntaxElement, TextRange, + ast::{self, Comment, CommentKind, CommentShape, Whitespace, edit::IndentLevel}, }; use crate::{AssistContext, AssistId, AssistKind, Assists}; @@ -167,11 +167,7 @@ pub(crate) fn line_comment_text(indentation: IndentLevel, comm: ast::Comment) -> let contents = contents_without_prefix.strip_prefix(' ').unwrap_or(contents_without_prefix); // Don't add the indentation if the line is empty - if contents.is_empty() { - contents.to_owned() - } else { - indentation.to_string() + contents - } + if contents.is_empty() { contents.to_owned() } else { indentation.to_string() + contents } } #[cfg(test)] |