We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9f4ef8 commit 95c7325Copy full SHA for 95c7325
src/lists.rs
@@ -572,10 +572,12 @@ where
572
let comment_end = match self.inner.peek() {
573
Some(..) => {
574
let mut block_open_index = post_snippet.find("/*");
575
- // check if it really is a block comment (and not //*)
+ // check if it really is a block comment (and not `//*` or a nested comment)
576
if let Some(i) = block_open_index {
577
- if i > 0 && &post_snippet[i - 1..i] == "/" {
578
- block_open_index = None;
+ match post_snippet.find("/") {
+ Some(j) if j < i => block_open_index = None,
579
+ _ if i > 0 && &post_snippet[i - 1..i] == "/" => block_open_index = None,
580
+ _ => (),
581
}
582
583
let newline_index = post_snippet.find('\n');
0 commit comments