Navigation Menu

Skip to content

Commit

Permalink
aw-query: fix clippy error
Browse files Browse the repository at this point in the history
  • Loading branch information
johan-bjareholt committed May 9, 2020
1 parent 2070bd7 commit 882385f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aw-query/src/functions.rs
Expand Up @@ -208,14 +208,14 @@ mod qfunctions {
) -> Result<DataType, QueryError> {
// typecheck
validate::args_length(&args, 2)?;
match args[0] {
match args.get(0).unwrap() {
DataType::List(ref list) => Ok(DataType::Bool(list.contains(&args[1]))),
DataType::Dict(ref dict) => {
let s = match &args[1] {
DataType::String(s) => s.to_string(),
_ => {
return Err(QueryError::InvalidFunctionParameters(format!(
"function contains got first argument {:?}, expected type List or Dict",
"function contains got second argument {:?}, expected type String",
args[0]
)))
}
Expand Down
6 changes: 5 additions & 1 deletion aw-query/src/lib.rs
Expand Up @@ -17,7 +17,11 @@ mod ast;
mod functions;
mod interpret;
mod lexer;
#[allow(clippy::match_single_binding, clippy::redundant_closure_call)]
#[allow(
clippy::match_single_binding,
clippy::redundant_closure_call,
unused_braces
)]
mod parser;

pub use crate::datatype::DataType;
Expand Down

0 comments on commit 882385f

Please sign in to comment.