diff options
Diffstat (limited to 'crates/syntax/src/ast/token_ext.rs')
-rw-r--r-- | crates/syntax/src/ast/token_ext.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/syntax/src/ast/token_ext.rs b/crates/syntax/src/ast/token_ext.rs index 6c242d126..29d25a58a 100644 --- a/crates/syntax/src/ast/token_ext.rs +++ b/crates/syntax/src/ast/token_ext.rs | |||
@@ -102,8 +102,9 @@ impl CommentKind { | |||
102 | kind | 102 | kind |
103 | } | 103 | } |
104 | 104 | ||
105 | fn prefix(&self) -> &'static str { | 105 | pub fn prefix(&self) -> &'static str { |
106 | let &(prefix, _) = CommentKind::BY_PREFIX.iter().find(|(_, kind)| kind == self).unwrap(); | 106 | let &(prefix, _) = |
107 | CommentKind::BY_PREFIX.iter().rev().find(|(_, kind)| kind == self).unwrap(); | ||
107 | prefix | 108 | prefix |
108 | } | 109 | } |
109 | } | 110 | } |
@@ -494,9 +495,8 @@ pub trait HasFormatSpecifier: AstToken { | |||
494 | } | 495 | } |
495 | _ => { | 496 | _ => { |
496 | while let Some((_, Ok(next_char))) = chars.peek() { | 497 | while let Some((_, Ok(next_char))) = chars.peek() { |
497 | match next_char { | 498 | if next_char == &'{' { |
498 | '{' => break, | 499 | break; |
499 | _ => {} | ||
500 | } | 500 | } |
501 | chars.next(); | 501 | chars.next(); |
502 | } | 502 | } |