Skip to content

Commit ba094e7

Browse files
authored
Minor: Clarify use of infallable APIs (#13217)
1 parent 6686e03 commit ba094e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

datafusion/expr/src/expr.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,13 +1563,13 @@ impl Expr {
15631563
/// Returns true if there are any column references in this Expr
15641564
pub fn any_column_refs(&self) -> bool {
15651565
self.exists(|expr| Ok(matches!(expr, Expr::Column(_))))
1566-
.unwrap()
1566+
.expect("exists closure is infallible")
15671567
}
15681568

1569-
/// Return true when the expression contains out reference(correlated) expressions.
1569+
/// Return true if the expression contains out reference(correlated) expressions.
15701570
pub fn contains_outer(&self) -> bool {
15711571
self.exists(|expr| Ok(matches!(expr, Expr::OuterReferenceColumn { .. })))
1572-
.unwrap()
1572+
.expect("exists closure is infallible")
15731573
}
15741574

15751575
/// Returns true if the expression node is volatile, i.e. whether it can return
@@ -1589,7 +1589,8 @@ impl Expr {
15891589
///
15901590
/// See [`Volatility`] for more information.
15911591
pub fn is_volatile(&self) -> bool {
1592-
self.exists(|expr| Ok(expr.is_volatile_node())).unwrap()
1592+
self.exists(|expr| Ok(expr.is_volatile_node()))
1593+
.expect("exists closure is infallible")
15931594
}
15941595

15951596
/// Recursively find all [`Expr::Placeholder`] expressions, and

0 commit comments

Comments
 (0)