diff options
author | Aleksey Kladov <[email protected]> | 2021-03-23 16:41:15 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-23 16:41:15 +0000 |
commit | e33959a8889104f6bda06755df9ade933aadcf4f (patch) | |
tree | ae7c4eaf788a52a98cc887c658437259902ea909 /crates/syntax | |
parent | 860e069d4dd141ad8d2f2f77a09b9a3ac762ce34 (diff) |
Simplify code
changelog: skip
Diffstat (limited to 'crates/syntax')
-rw-r--r-- | crates/syntax/src/ast/token_ext.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/syntax/src/ast/token_ext.rs b/crates/syntax/src/ast/token_ext.rs index 090282d28..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 | } |