File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -208,14 +208,14 @@ mod qfunctions {
208
208
) -> Result < DataType , QueryError > {
209
209
// typecheck
210
210
validate:: args_length ( & args, 2 ) ?;
211
- match args[ 0 ] {
211
+ match args. get ( 0 ) . unwrap ( ) {
212
212
DataType :: List ( ref list) => Ok ( DataType :: Bool ( list. contains ( & args[ 1 ] ) ) ) ,
213
213
DataType :: Dict ( ref dict) => {
214
214
let s = match & args[ 1 ] {
215
215
DataType :: String ( s) => s. to_string ( ) ,
216
216
_ => {
217
217
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 " ,
219
219
args[ 0 ]
220
220
) ) )
221
221
}
Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ mod ast;
17
17
mod functions;
18
18
mod interpret;
19
19
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
+ ) ]
21
25
mod parser;
22
26
23
27
pub use crate :: datatype:: DataType ;
You can’t perform that action at this time.
0 commit comments