diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-23 16:44:28 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-23 16:44:28 +0000 |
commit | c220b340958c447b72330148e44f24c9204f84c2 (patch) | |
tree | e9ab2300f32cb8a03dd6558e57c36dbb4fd31cb3 /crates/syntax/src | |
parent | c88129d5634e4ca9b856c07d48a8161c3c8ec3f5 (diff) | |
parent | e33959a8889104f6bda06755df9ade933aadcf4f (diff) |
Merge #8174
8174: Simplify code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/syntax/src')
-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 | } |