Skip to content

Commit

Permalink
validate string bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsairobo committed Dec 17, 2023
1 parent 4993e72 commit c789a78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/evaluate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl BoolExpression {
registers: &mut Registers,
) -> Vec<bool> {
validate_bindings(real_bindings, registers.register_length);
validate_bindings(string_bindings, registers.register_length);
self.evaluate_recursive(
real_bindings,
string_bindings,
Expand Down Expand Up @@ -193,7 +194,7 @@ impl RealExpression {
}
}

fn validate_bindings<R: AsRef<[f64]>>(input_bindings: &[R], expected_length: usize) {
fn validate_bindings<T, B: AsRef<[T]>>(input_bindings: &[B], expected_length: usize) {
for b in input_bindings.iter() {
assert_eq!(b.as_ref().len(), expected_length);
}
Expand Down

0 comments on commit c789a78

Please sign in to comment.