diff --git a/Cargo.toml b/Cargo.toml index b6098a636954f..adb3ee23d947c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ homepage = "https://datafusion.apache.org" license = "Apache-2.0" readme = "README.md" repository = "https://github.com/apache/datafusion" -rust-version = "1.81.0" +rust-version = "1.82.0" version = "45.0.0" [workspace.dependencies] diff --git a/datafusion/common/src/table_reference.rs b/datafusion/common/src/table_reference.rs index bb53a30dcb234..9b6f9696c00bb 100644 --- a/datafusion/common/src/table_reference.rs +++ b/datafusion/common/src/table_reference.rs @@ -193,8 +193,7 @@ impl TableReference { match self { TableReference::Bare { table } => **table == *other.table(), TableReference::Partial { schema, table } => { - **table == *other.table() - && other.schema().map_or(true, |s| *s == **schema) + **table == *other.table() && other.schema().is_none_or(|s| *s == **schema) } TableReference::Full { catalog, @@ -202,8 +201,8 @@ impl TableReference { table, } => { **table == *other.table() - && other.schema().map_or(true, |s| *s == **schema) - && other.catalog().map_or(true, |c| *c == **catalog) + && other.schema().is_none_or(|s| *s == **schema) + && other.catalog().is_none_or(|c| *c == **catalog) } } } diff --git a/datafusion/expr/src/utils.rs b/datafusion/expr/src/utils.rs index 86c0f9ad637c6..56c1e64554a90 100644 --- a/datafusion/expr/src/utils.rs +++ b/datafusion/expr/src/utils.rs @@ -832,7 +832,7 @@ pub fn exprlist_len( .enumerate() .filter_map(|(idx, field)| { let (maybe_table_ref, _) = schema.qualified_field(idx); - if maybe_table_ref.map_or(true, |q| q == qualifier) { + if maybe_table_ref.is_none_or(|q| q == qualifier) { Some((maybe_table_ref.cloned(), Arc::clone(field))) } else { None diff --git a/datafusion/physical-expr-common/src/sort_expr.rs b/datafusion/physical-expr-common/src/sort_expr.rs index b150d3dc9bd38..601b2a23d09da 100644 --- a/datafusion/physical-expr-common/src/sort_expr.rs +++ b/datafusion/physical-expr-common/src/sort_expr.rs @@ -172,13 +172,11 @@ impl PhysicalSortExpr { let nullable = self.expr.nullable(schema).unwrap_or(true); self.expr.eq(&requirement.expr) && if nullable { - requirement - .options - .map_or(true, |opts| self.options == opts) + requirement.options.is_none_or(|opts| self.options == opts) } else { requirement .options - .map_or(true, |opts| self.options.descending == opts.descending) + .is_none_or(|opts| self.options.descending == opts.descending) } } } @@ -293,7 +291,7 @@ impl PhysicalSortRequirement { self.expr.eq(&other.expr) && other .options - .map_or(true, |other_opts| self.options == Some(other_opts)) + .is_none_or(|other_opts| self.options == Some(other_opts)) } #[deprecated(since = "43.0.0", note = "use LexRequirement::from_lex_ordering")] diff --git a/datafusion/physical-expr/src/equivalence/properties.rs b/datafusion/physical-expr/src/equivalence/properties.rs index 96208cc5e32c9..838cb26807a9f 100755 --- a/datafusion/physical-expr/src/equivalence/properties.rs +++ b/datafusion/physical-expr/src/equivalence/properties.rs @@ -640,7 +640,7 @@ impl EquivalenceProperties { req.expr.eq(&existing.expr) && req .options - .map_or(true, |req_opts| req_opts == existing.options) + .is_none_or(|req_opts| req_opts == existing.options) }, ) }) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index bd764d2010186..11f4fb798c376 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -19,5 +19,5 @@ # to compile this workspace and run CI jobs. [toolchain] -channel = "1.84.1" +channel = "1.85.0" components = ["rustfmt", "clippy"]