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_mbe/src/parser.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/ra_mbe') diff --git a/crates/ra_mbe/src/parser.rs b/crates/ra_mbe/src/parser.rs index 034150432..1e5dafbdf 100644 --- a/crates/ra_mbe/src/parser.rs +++ b/crates/ra_mbe/src/parser.rs @@ -137,10 +137,7 @@ fn eat_fragment_kind<'a>( } fn is_boolean_literal(lit: &tt::Literal) -> bool { - match lit.text.as_str() { - "true" | "false" => true, - _ => false, - } + matches!(lit.text.as_str(), "true" | "false") } fn parse_repeat(src: &mut TtIter) -> Result<(Option, RepeatKind), ExpandError> { -- cgit v1.2.3