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_syntax/src/ast/extensions.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_syntax/src/ast/extensions.rs') diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index 98c38d009..662c6f73e 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs @@ -459,16 +459,16 @@ impl ast::RangePat { impl ast::TokenTree { pub fn left_delimiter_token(&self) -> Option { - self.syntax().first_child_or_token()?.into_token().filter(|it| match it.kind() { - T!['{'] | T!['('] | T!['['] => true, - _ => false, - }) + self.syntax() + .first_child_or_token()? + .into_token() + .filter(|it| matches!(it.kind(), T!['{'] | T!['('] | T!['['])) } pub fn right_delimiter_token(&self) -> Option { - self.syntax().last_child_or_token()?.into_token().filter(|it| match it.kind() { - T!['}'] | T![')'] | T![']'] => true, - _ => false, - }) + self.syntax() + .last_child_or_token()? + .into_token() + .filter(|it| matches!(it.kind(), T!['}'] | T![')'] | T![']'])) } } -- cgit v1.2.3