From e75e2ae5b6b6b1364368ceb3d4081b6508b2f001 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 28 Jun 2020 04:02:03 +0300 Subject: Simlify with matches!() --- crates/ra_parser/src/grammar.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/ra_parser/src/grammar.rs') diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 293baecf6..caedeead0 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -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) { -- cgit v1.2.3