remove nested match with and_then

This commit is contained in:
Luuk Wester 2024-05-24 22:57:35 +02:00
parent f5d740aa3d
commit 9e5ff0dce7

View file

@ -27,10 +27,7 @@ pub(crate) fn convert_comment_from_or_to_doc(
match comment.kind().doc {
Some(_) => doc_to_comment(acc, comment),
None => match can_be_doc_comment(&comment) {
Some(doc_comment_style) => comment_to_doc(acc, comment, doc_comment_style),
None => None,
},
None => can_be_doc_comment(&comment).and_then(|style| comment_to_doc(acc, comment, style)),
}
}