Tokens - Use the matches! macro for is_litteral()
This commit is contained in:
parent
980729ceb3
commit
0872f58baf
1 changed files with 7 additions and 7 deletions
|
@ -57,13 +57,13 @@ pub struct Token {
|
|||
impl Token {
|
||||
/// Check whether a token corresponds to a litteral value.
|
||||
pub fn is_litteral(&self) -> bool {
|
||||
match self.token_type {
|
||||
matches!(
|
||||
self.token_type,
|
||||
TokenType::True
|
||||
| TokenType::False
|
||||
| TokenType::Nil
|
||||
| TokenType::String(_)
|
||||
| TokenType::Number(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
| TokenType::Number(_)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue