Simplify code

changelog: skip
This commit is contained in:
Aleksey Kladov 2021-03-23 19:41:15 +03:00
parent 860e069d4d
commit e33959a888
3 changed files with 18 additions and 39 deletions

View file

@ -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
}
}