From e33959a8889104f6bda06755df9ade933aadcf4f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 23 Mar 2021 19:41:15 +0300 Subject: Simplify code changelog: skip --- crates/syntax/src/ast/token_ext.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/syntax/src') 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 { kind } - fn prefix(&self) -> &'static str { - let &(prefix, _) = CommentKind::BY_PREFIX.iter().find(|(_, kind)| kind == self).unwrap(); + pub fn prefix(&self) -> &'static str { + let &(prefix, _) = + CommentKind::BY_PREFIX.iter().rev().find(|(_, kind)| kind == self).unwrap(); prefix } } -- cgit v1.2.3