Reassemble a list of conjuncts into a right-leaning AND tree. Empty input returns `None`; single input returns itself.
(mut conjuncts: Vec<SqlExpr>)
| 353 | /// Reassemble a list of conjuncts into a right-leaning AND tree. |
| 354 | /// Empty input returns `None`; single input returns itself. |
| 355 | fn rebuild_and(mut conjuncts: Vec<SqlExpr>) -> Option<SqlExpr> { |
| 356 | let last = conjuncts.pop()?; |
| 357 | Some( |
| 358 | conjuncts |
| 359 | .into_iter() |
| 360 | .rfold(last, |acc, next| SqlExpr::BinaryOp { |
| 361 | left: Box::new(next), |
| 362 | op: BinaryOp::And, |
| 363 | right: Box::new(acc), |
| 364 | }), |
| 365 | ) |
| 366 | } |
| 367 | |
| 368 | /// Decide whether the query's WHERE conjuncts entail the partial-index |
| 369 | /// predicate. `None` predicate means a full index — trivially entailed. |
no outgoing calls
no test coverage detected