From 5bba900a3d42a2005db31945201f8b6ccbf15586 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sat, 16 Oct 2021 20:24:36 -0700 Subject: [PATCH] Clippy notes in operators.rs --- schala-lang/language/src/ast/operators.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/schala-lang/language/src/ast/operators.rs b/schala-lang/language/src/ast/operators.rs index d02b6c5..b55d423 100644 --- a/schala-lang/language/src/ast/operators.rs +++ b/schala-lang/language/src/ast/operators.rs @@ -17,12 +17,7 @@ impl PrefixOp { } pub fn is_prefix(op: &str) -> bool { - match op { - "+" => true, - "-" => true, - "!" => true, - _ => false - } + matches!(op, "+" | "-" | "!") } } @@ -54,7 +49,7 @@ impl BinOp { } } -fn token_kind_to_sigil<'a>(tok: &'a TokenKind) -> Option<&'a str> { +fn token_kind_to_sigil(tok: & TokenKind) -> Option<&str> { use self::TokenKind::*; Some(match tok { Operator(op) => op.as_str(),