Skip to content

Commit 882385f

Browse files
aw-query: fix clippy error
1 parent 2070bd7 commit 882385f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

aw-query/src/functions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ mod qfunctions {
208208
) -> Result<DataType, QueryError> {
209209
// typecheck
210210
validate::args_length(&args, 2)?;
211-
match args[0] {
211+
match args.get(0).unwrap() {
212212
DataType::List(ref list) => Ok(DataType::Bool(list.contains(&args[1]))),
213213
DataType::Dict(ref dict) => {
214214
let s = match &args[1] {
215215
DataType::String(s) => s.to_string(),
216216
_ => {
217217
return Err(QueryError::InvalidFunctionParameters(format!(
218-
"function contains got first argument {:?}, expected type List or Dict",
218+
"function contains got second argument {:?}, expected type String",
219219
args[0]
220220
)))
221221
}

aw-query/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ mod ast;
1717
mod functions;
1818
mod interpret;
1919
mod lexer;
20-
#[allow(clippy::match_single_binding, clippy::redundant_closure_call)]
20+
#[allow(
21+
clippy::match_single_binding,
22+
clippy::redundant_closure_call,
23+
unused_braces
24+
)]
2125
mod parser;
2226

2327
pub use crate::datatype::DataType;

0 commit comments

Comments
 (0)