Skip to content

Commit d2f7c0d

Browse files
timsaucerclaude
andcommitted
chore: drop unused borrow_deref_ref allows
Seven `#[allow(clippy::borrow_deref_ref)]` attributes on module declarations in `crates/core/src/lib.rs` had become stale — the only remaining lint hit was a redundant `&*x.as_str()` pattern in `parse_file_compression_type`. Rewriting that call to `&x.unwrap_or_default()` lets every allow come off, removing noise that new modules were copying without need. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3f0f4e3 commit d2f7c0d

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

crates/core/src/context.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,10 +1576,9 @@ impl PySessionContext {
15761576
pub fn parse_file_compression_type(
15771577
file_compression_type: Option<String>,
15781578
) -> Result<FileCompressionType, PyErr> {
1579-
FileCompressionType::from_str(&*file_compression_type.unwrap_or("".to_string()).as_str())
1580-
.map_err(|_| {
1581-
PyValueError::new_err("file_compression_type must one of: gzip, bz2, xz, zstd")
1582-
})
1579+
FileCompressionType::from_str(&file_compression_type.unwrap_or_default()).map_err(|_| {
1580+
PyValueError::new_err("file_compression_type must one of: gzip, bz2, xz, zstd")
1581+
})
15831582
}
15841583

15851584
impl From<PySessionContext> for SessionContext {

crates/core/src/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,23 @@ pub use datafusion_substrait;
2626
use mimalloc::MiMalloc;
2727
use pyo3::prelude::*;
2828

29-
#[allow(clippy::borrow_deref_ref)]
3029
pub mod catalog;
3130
pub mod codec;
3231
pub mod common;
3332

34-
#[allow(clippy::borrow_deref_ref)]
3533
pub mod context;
36-
#[allow(clippy::borrow_deref_ref)]
3734
pub mod dataframe;
3835
mod dataset;
3936
mod dataset_exec;
4037
pub mod errors;
41-
#[allow(clippy::borrow_deref_ref)]
4238
pub mod expr;
43-
#[allow(clippy::borrow_deref_ref)]
4439
mod functions;
4540
pub mod metrics;
4641
mod options;
4742
pub mod physical_plan;
4843
mod pyarrow_filter_expression;
4944
pub mod pyarrow_util;
5045
mod record_batch;
51-
#[allow(clippy::borrow_deref_ref)]
5246
mod spark_functions;
5347
pub mod sql;
5448
pub mod store;
@@ -58,9 +52,7 @@ pub mod unparser;
5852
mod array;
5953
#[cfg(feature = "substrait")]
6054
pub mod substrait;
61-
#[allow(clippy::borrow_deref_ref)]
6255
mod udaf;
63-
#[allow(clippy::borrow_deref_ref)]
6456
mod udf;
6557
pub mod udtf;
6658
mod udwf;

0 commit comments

Comments
 (0)