Skip to content

Commit 300c2af

Browse files
authored
Fix clippy for Rust 1.84 (#14065)
1 parent bf28e9b commit 300c2af

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

datafusion/common/src/pyarrow.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ mod tests {
138138
fn test_py_scalar() {
139139
init_python();
140140

141+
// TODO: remove this attribute when bumping pyo3 to v0.23.0
142+
// See: <https://github.com/PyO3/pyo3/blob/v0.23.0/guide/src/migration.md#gil-refs-feature-removed>
143+
#[allow(unexpected_cfgs)]
141144
Python::with_gil(|py| {
142145
let scalar_float = ScalarValue::Float64(Some(12.34));
143146
let py_float = scalar_float.into_py(py).call_method0(py, "as_py").unwrap();

datafusion/core/src/datasource/listing/table.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,8 +1148,8 @@ impl ListingTable {
11481148
/// This method first checks if the statistics for the given file are already cached.
11491149
/// If they are, it returns the cached statistics.
11501150
/// If they are not, it infers the statistics from the file and stores them in the cache.
1151-
async fn do_collect_statistics<'a>(
1152-
&'a self,
1151+
async fn do_collect_statistics(
1152+
&self,
11531153
ctx: &SessionState,
11541154
store: &Arc<dyn ObjectStore>,
11551155
part_file: &PartitionedFile,

datafusion/core/src/execution/context/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ impl SessionContext {
10471047
Ok(table)
10481048
}
10491049

1050-
async fn find_and_deregister<'a>(
1050+
async fn find_and_deregister(
10511051
&self,
10521052
table_ref: impl Into<TableReference>,
10531053
table_type: TableType,
@@ -1481,10 +1481,7 @@ impl SessionContext {
14811481
/// provided reference.
14821482
///
14831483
/// [`register_table`]: SessionContext::register_table
1484-
pub async fn table<'a>(
1485-
&self,
1486-
table_ref: impl Into<TableReference>,
1487-
) -> Result<DataFrame> {
1484+
pub async fn table(&self, table_ref: impl Into<TableReference>) -> Result<DataFrame> {
14881485
let table_ref: TableReference = table_ref.into();
14891486
let provider = self.table_provider(table_ref.clone()).await?;
14901487
let plan = LogicalPlanBuilder::scan(
@@ -1511,7 +1508,7 @@ impl SessionContext {
15111508
}
15121509

15131510
/// Return a [`TableProvider`] for the specified table.
1514-
pub async fn table_provider<'a>(
1511+
pub async fn table_provider(
15151512
&self,
15161513
table_ref: impl Into<TableReference>,
15171514
) -> Result<Arc<dyn TableProvider>> {

datafusion/physical-expr-common/src/physical_expr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ pub trait DynEq {
159159

160160
impl<T: Eq + Any> DynEq for T {
161161
fn dyn_eq(&self, other: &dyn Any) -> bool {
162-
other
163-
.downcast_ref::<Self>()
164-
.map_or(false, |other| other == self)
162+
other.downcast_ref::<Self>() == Some(self)
165163
}
166164
}
167165

datafusion/physical-expr-common/src/sort_expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ impl PhysicalSortRequirement {
291291
/// Returns whether this requirement is equal or more specific than `other`.
292292
pub fn compatible(&self, other: &PhysicalSortRequirement) -> bool {
293293
self.expr.eq(&other.expr)
294-
&& other.options.map_or(true, |other_opts| {
295-
self.options.map_or(false, |opts| opts == other_opts)
296-
})
294+
&& other
295+
.options
296+
.map_or(true, |other_opts| self.options == Some(other_opts))
297297
}
298298

299299
#[deprecated(since = "43.0.0", note = "use LexRequirement::from_lex_ordering")]

0 commit comments

Comments
 (0)