all: clippy

This commit is contained in:
Ryan Chandler 2022-07-19 16:32:21 +01:00
parent 2b2ec2253f
commit e1fe663fc2
No known key found for this signature in database
GPG Key ID: F113BCADDB3B0CCA
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ impl Lexer {
if !buffer.is_empty() {
tokens.push(Token {
kind: TokenKind::InlineHtml(buffer),
span: (self.line, self.col.checked_sub(5).unwrap_or(0)),
span: (self.line, self.col.saturating_sub(5)),
});
}

View File

@ -105,7 +105,7 @@ impl Parser {
Statement::Property { var }
},
s @ Statement::Method { .. } => s,
_ => return Err(ParseError::InvalidClassStatement(format!("Classes can only contain properties, constants and methods."), self.current.span))
_ => return Err(ParseError::InvalidClassStatement("Classes can only contain properties, constants and methods.".to_string(), self.current.span))
};
body.push(statement);