fix clippy lints

This commit is contained in:
elkowar 2021-07-17 18:11:54 +02:00
parent d12d129eb8
commit dacb6e49e2
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
3 changed files with 6 additions and 4 deletions

1
Cargo.lock generated
View file

@ -648,7 +648,6 @@ checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"
name = "simplexpr"
version = "0.1.0"
dependencies = [
"codespan-reporting",
"itertools",
"lalrpop",
"lalrpop-util",

View file

@ -19,12 +19,15 @@ use itertools::Itertools;
use lalrpop_util::lalrpop_mod;
lalrpop_mod!(pub parser);
lalrpop_mod!(
#[allow(clippy::all)]
pub parser
);
pub fn parse_string(file_id: usize, s: &str) -> AstResult<Ast> {
let lexer = lexer::Lexer::new(file_id, s);
let parser = parser::AstParser::new();
Ok(parser.parse(file_id, lexer).map_err(|e| AstError::from_parse_error(file_id, e))?)
parser.parse(file_id, lexer).map_err(|e| AstError::from_parse_error(file_id, e))
}
macro_rules! test_parser {

View file

@ -64,7 +64,7 @@ impl FromStr for Coords {
fn from_str(s: &str) -> Result<Self, Self::Err> {
let (x, y) = s
.split_once(|x: char| x.to_ascii_lowercase() == 'x' || x.to_ascii_lowercase() == '*')
.ok_or_else(|| Error::MalformedCoords)?;
.ok_or(Error::MalformedCoords)?;
Coords::from_strs(x, y)
}
}