Repository: apache/datafusion (language: rust)

Issue:
Upgrade to Rust 1.85
### Is your feature request related to a problem or challenge?

Rust 1.85 is released: https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html

Currently DataFusion uses the version of rust specified here:
https://github.com/apache/datafusion/blob/main/rust-toolchain.toml



### Describe the solution you'd like

I would like to:
1. Update the tool chain to 1.85 (likely requires fixing / updating clippy)
2. Update the MSRV (min supported rust version) to the next version: https://github.com/apache/datafusion/blob/188e0d31d192fa6168e9529459136677968829f1/Cargo.toml#L69

### Describe alternatives you've considered

_No response_

### Additional context

I think this would be a good first issue as it is relatively mechanical 


Discussion / hints:

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index b6098a636954..adb3ee23d947 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 bb53a30dcb23..9b6f9696c00b 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 86c0f9ad637c..56c1e64554a9 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 b150d3dc9bd3..601b2a23d09d 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 96208cc5e32c..838cb26807a9 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 bd764d201018..11f4fb798c37 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"]


Test patch: