Skip to content

Commit d8c156f

Browse files
use expect over allow in clippy (#7373)
remove #[allow(....)
1 parent a78897f commit d8c156f

197 files changed

Lines changed: 235 additions & 350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎benchmarks/datafusion-bench/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use vortex_datafusion::VortexFormat;
3030
use vortex_datafusion::VortexFormatFactory;
3131
use vortex_datafusion::VortexTableOptions;
3232

33-
#[allow(clippy::expect_used)]
33+
#[expect(clippy::expect_used)]
3434
pub fn get_session_context() -> SessionContext {
3535
let mut rt_builder = RuntimeEnvBuilder::new();
3636

‎benchmarks/datafusion-bench/src/main.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async fn main() -> anyhow::Result<()> {
156156

157157
// Collect execution plans for metrics if show_metrics is enabled
158158
// Structure: (query_idx, format, execution_plan)
159-
#[allow(clippy::type_complexity)]
159+
#[expect(clippy::type_complexity)]
160160
let collected_plans: Arc<Mutex<Vec<(usize, Format, Arc<dyn ExecutionPlan>)>>> =
161161
Arc::new(Mutex::new(Vec::new()));
162162
let show_metrics = args.show_metrics;

‎benchmarks/datafusion-bench/src/metrics.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl MetricsSetExt for MetricsSet {
4747
}
4848
}
4949

50-
#[allow(clippy::disallowed_types)]
50+
#[expect(clippy::disallowed_types)]
5151
fn aggregate(&self) -> Self {
5252
use std::collections::HashMap;
5353
let mut map = HashMap::new();

‎benchmarks/duckdb-bench/build.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
#![allow(clippy::unwrap_used)]
5-
#![allow(clippy::expect_used)]
4+
#![expect(clippy::unwrap_used)]
65

76
/// Adds a dynamic linker runtime path pointing to the DuckDB dylib dir.
87
///

‎benchmarks/random-access-bench/src/main.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ fn generate_indices(dataset: &dyn BenchDataset, pattern: AccessPattern) -> Vec<u
9191
// ~POISSON_EXPECTED_COUNT indices across the dataset.
9292
let rate = POISSON_EXPECTED_COUNT as f64 / row_count as f64;
9393
// SAFETY: rate is always positive (POISSON_EXPECTED_COUNT > 0, row_count > 0).
94-
#[allow(clippy::unwrap_used)]
94+
#[expect(clippy::unwrap_used)]
9595
let exp = Exp::new(rate).unwrap();
9696
let mut indices = Vec::with_capacity(POISSON_EXPECTED_COUNT);
9797
let mut pos = 0.0_f64;
9898
loop {
9999
let gap: f64 = exp.sample(&mut rng);
100100
pos += gap;
101-
#[allow(clippy::cast_possible_truncation)]
101+
#[expect(clippy::cast_possible_truncation)]
102102
let idx = pos as u64;
103103
if idx >= row_count {
104104
break;

‎encodings/alp/benches/alp_compress.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
#![allow(clippy::unwrap_used)]
4+
#![expect(clippy::unwrap_used)]
55

66
use divan::Bencher;
77
use rand::RngExt;

‎encodings/alp/src/alp/compress.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ mod tests {
173173
}
174174

175175
#[test]
176-
#[allow(clippy::approx_constant)] // Clippy objects to 2.718, an approximation of e, the base of the natural logarithm.
176+
#[expect(clippy::approx_constant)] // Clippy objects to 2.718, an approximation of e, the base of the natural logarithm.
177177
fn test_patched_compress() {
178178
let values = buffer![1.234f64, 2.718, PI, 4.0];
179179
let array = PrimitiveArray::new(values.clone(), Validity::NonNullable);
@@ -190,7 +190,7 @@ mod tests {
190190
}
191191

192192
#[test]
193-
#[allow(clippy::approx_constant)] // Clippy objects to 2.718, an approximation of e, the base of the natural logarithm.
193+
#[expect(clippy::approx_constant)] // Clippy objects to 2.718, an approximation of e, the base of the natural logarithm.
194194
fn test_compress_ignores_invalid_exceptional_values() {
195195
let values = buffer![1.234f64, 2.718, PI, 4.0];
196196
let array = PrimitiveArray::new(values, Validity::from_iter([true, true, false, true]));
@@ -207,7 +207,7 @@ mod tests {
207207
}
208208

209209
#[test]
210-
#[allow(clippy::approx_constant)] // ALP doesn't like E
210+
#[expect(clippy::approx_constant)] // ALP doesn't like E
211211
fn test_nullable_patched_scalar_at() {
212212
let array = PrimitiveArray::from_option_iter([
213213
Some(1.234f64),

‎encodings/alp/src/alp/compute/compare.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,12 @@ mod tests {
213213
vec![1234; 1025]
214214
);
215215

216-
#[allow(clippy::excessive_precision)]
217216
let r_eq = alp_scalar_compare(encoded.as_view(), 1.234444_f32, CompareOperator::Eq)
218217
.unwrap()
219218
.unwrap();
220219
let expected = BoolArray::from_iter([false; 1025]);
221220
assert_arrays_eq!(r_eq, expected);
222221

223-
#[allow(clippy::excessive_precision)]
224222
let r_neq = alp_scalar_compare(encoded.as_view(), 1.234444f32, CompareOperator::NotEq)
225223
.unwrap()
226224
.unwrap();

‎encodings/alp/src/alp_rd/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
#![allow(clippy::cast_possible_truncation)]
4+
#![expect(clippy::cast_possible_truncation)]
55

66
pub use array::*;
77
use vortex_array::ExecutionCtx;

‎encodings/fastlanes/benches/bit_transpose.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
#![allow(clippy::unwrap_used)]
5-
64
use divan::Bencher;
75
use vortex_fastlanes::bit_transpose::scalar::transpose_bits_scalar;
86
use vortex_fastlanes::bit_transpose::scalar::untranspose_bits_scalar;
@@ -12,7 +10,7 @@ fn main() {
1210
}
1311

1412
/// Generate deterministic test data.
15-
#[allow(clippy::cast_possible_truncation)]
13+
#[expect(clippy::cast_possible_truncation)]
1614
fn generate_test_data(seed: usize) -> [u8; 128] {
1715
let mut data = [0u8; 128];
1816
for (i, byte) in data.iter_mut().enumerate() {

0 commit comments

Comments
 (0)