Skip to content

Commit a66dbd1

Browse files
committed
v2
1 parent b316bcc commit a66dbd1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/ide-assists/src/handlers/convert_comment_block.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ pub(crate) fn relevant_line_comments(comment: &ast::Comment) -> Vec<Comment> {
164164
//
165165
// But since such comments aren't idiomatic we're okay with this.
166166
pub(crate) fn line_comment_text(indentation: IndentLevel, comm: ast::Comment) -> Option<String> {
167-
let contents_without_prefix = comm.text().strip_prefix(comm.prefix())?;
167+
let text = comm.text();
168+
let contents_without_prefix = text.strip_prefix(comm.prefix()).unwrap_or(text);
168169
let contents = contents_without_prefix.strip_prefix(' ').unwrap_or(contents_without_prefix);
169170

170171
// Don't add the indentation if the line is empty

0 commit comments

Comments
 (0)