Skip to content

Commit 0007138

Browse files
committed
remove nested match with and_then
1 parent 28399f9 commit 0007138

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_comment_from_or_to_doc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ pub(crate) fn convert_comment_from_or_to_doc(
2727

2828
match comment.kind().doc {
2929
Some(_) => doc_to_comment(acc, comment),
30-
None => match can_be_doc_comment(&comment) {
31-
Some(doc_comment_style) => comment_to_doc(acc, comment, doc_comment_style),
32-
None => None,
33-
},
30+
None => can_be_doc_comment(&comment).and_then(|style| comment_to_doc(acc, comment, style)),
3431
}
3532
}
3633

0 commit comments

Comments
 (0)