fix clippy lints
This commit is contained in:
parent
d12d129eb8
commit
dacb6e49e2
3 changed files with 6 additions and 4 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -648,7 +648,6 @@ checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"
|
|||
name = "simplexpr"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"codespan-reporting",
|
||||
"itertools",
|
||||
"lalrpop",
|
||||
"lalrpop-util",
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue