Makes Clippy happy

pull/171/head
Tpt 3 years ago
parent f0bd89d77f
commit 01da768003
  1. 2
      js/src/model.rs
  2. 13
      spargebra/src/parser.rs

@ -1,3 +1,5 @@
#![allow(dead_code)]
use crate::format_err;
use crate::utils::to_err;
use js_sys::{Reflect, UriError};

@ -578,7 +578,7 @@ fn are_variables_bound(expression: &Expression, variables: &HashSet<Variable>) -
| Expression::Exists(_) => true,
Expression::Variable(var) => variables.contains(var),
Expression::UnaryPlus(e) | Expression::UnaryMinus(e) | Expression::Not(e) => {
are_variables_bound(&e, variables)
are_variables_bound(e, variables)
}
Expression::Or(a, b)
| Expression::And(a, b)
@ -592,19 +592,18 @@ fn are_variables_bound(expression: &Expression, variables: &HashSet<Variable>) -
| Expression::Subtract(a, b)
| Expression::Multiply(a, b)
| Expression::Divide(a, b) => {
are_variables_bound(&a, variables) && are_variables_bound(&b, variables)
are_variables_bound(a, variables) && are_variables_bound(b, variables)
}
Expression::In(a, b) => {
are_variables_bound(&a, variables)
&& b.iter().all(|b| are_variables_bound(b, variables))
are_variables_bound(a, variables) && b.iter().all(|b| are_variables_bound(b, variables))
}
Expression::FunctionCall(_, parameters) => {
parameters.iter().all(|p| are_variables_bound(p, variables))
}
Expression::If(a, b, c) => {
are_variables_bound(&a, variables)
&& are_variables_bound(&b, variables)
&& are_variables_bound(&c, variables)
are_variables_bound(a, variables)
&& are_variables_bound(b, variables)
&& are_variables_bound(c, variables)
}
}
}

Loading…
Cancel
Save