Clippy notes in operators.rs

This commit is contained in:
Greg Shuflin 2021-10-16 20:24:36 -07:00
parent 2fe4109296
commit 5bba900a3d
1 changed files with 2 additions and 7 deletions

View File

@ -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(),