Simlify with matches!()

This commit is contained in:
Veetaha 2020-06-28 04:02:03 +03:00
parent 513924a7e0
commit e75e2ae5b6
20 changed files with 32 additions and 98 deletions

View file

@ -73,10 +73,7 @@ pub(crate) mod fragments {
// Parse a meta item , which excluded [], e.g : #[ MetaItem ]
pub(crate) fn meta_item(p: &mut Parser) {
fn is_delimiter(p: &mut Parser) -> bool {
match p.current() {
T!['{'] | T!['('] | T!['['] => true,
_ => false,
}
matches!(p.current(), T!['{'] | T!['('] | T!['['])
}
if is_delimiter(p) {