Skip to content

Commit 1b33172

Browse files
committed
clippy
1 parent 2a998ff commit 1b33172

File tree

13 files changed

+35
-46
lines changed

13 files changed

+35
-46
lines changed

src/common/ttl_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ mod tests {
409409
}
410410
tokio::time::sleep(Duration::from_millis(10)).await;
411411
}
412-
panic!("Assertion failed within {:?}", timeout);
412+
panic!("Assertion failed within {timeout:?}");
413413
}
414414

415415
#[tokio::test(flavor = "multi_thread", worker_threads = 8)]
@@ -543,9 +543,9 @@ mod tests {
543543
let elapsed = start_time.elapsed();
544544

545545
println!("\n=== TTLMap Lock Contention Benchmark ===");
546-
println!("Tasks: {}", task_count);
547-
println!("Total time: {:.2?}", elapsed);
548-
println!("Average latency: {:.2} ns per operation", avg_time);
546+
println!("Tasks: {task_count}");
547+
println!("Total time: {elapsed:.2?}");
548+
println!("Average latency: {avg_time:.2} ns per operation");
549549
println!("Entries remaining: {}", ttl_map.data.len());
550550
println!(
551551
"DashMap Lock contention time: {}ms",

src/execution_plans/network_shuffle.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ use tonic::metadata::MetadataMap;
112112
/// 2. Ready: runs within a distributed stage and queries the next input stage over the network
113113
/// using Arrow Flight.
114114
#[derive(Debug, Clone)]
115+
#[allow(clippy::large_enum_variant)]
115116
pub enum NetworkShuffleExec {
116117
Pending(NetworkShufflePendingExec),
117118
Ready(NetworkShuffleReadyExec),

src/execution_plans/partition_isolator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ use std::{fmt::Formatter, sync::Arc};
5050
/// └───────────────────────────┘ └───────────────────────────┘ └───────────────────────────┘ ■
5151
/// ```
5252
#[derive(Debug)]
53+
#[allow(clippy::large_enum_variant)]
5354
pub enum PartitionIsolatorExec {
5455
Pending(PartitionIsolatorPendingExec),
5556
Ready(PartitionIsolatorReadyExec),
@@ -223,7 +224,7 @@ impl ExecutionPlan for PartitionIsolatorExec {
223224
// then look up that index in our group and execute that partition, in this
224225
// example partition 8
225226

226-
let output_stream = match partition_group.get(partition) {
227+
match partition_group.get(partition) {
227228
Some(actual_partition_number) => {
228229
if *actual_partition_number >= input_partitions {
229230
//trace!("{} returning empty stream", ctx_name);
@@ -239,8 +240,7 @@ impl ExecutionPlan for PartitionIsolatorExec {
239240
Box::pin(EmptyRecordBatchStream::new(self_ready.input.schema()))
240241
as SendableRecordBatchStream,
241242
),
242-
};
243-
output_stream
243+
}
244244
}
245245
}
246246

src/metrics/metrics_collecting_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ where
4747

4848
let metadata =
4949
FlightAppMetadata::decode(flight_data.app_metadata.as_ref()).map_err(|e| {
50-
FlightError::ProtocolError(format!("failed to decode app_metadata: {}", e))
50+
FlightError::ProtocolError(format!("failed to decode app_metadata: {e}"))
5151
})?;
5252

5353
let Some(content) = metadata.content else {

src/metrics/proto.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -440,38 +440,33 @@ mod tests {
440440
let roundtrip_count = roundtrip_metrics_set.iter().count();
441441
assert_eq!(
442442
original_count, roundtrip_count,
443-
"roundtrip should preserve metrics count for {}",
444-
test_name
443+
"roundtrip should preserve metrics count for {test_name}"
445444
);
446445

447446
// Verify equivalence of each metric.
448447
for (original, roundtrip) in metrics_set.iter().zip(roundtrip_metrics_set.iter()) {
449448
assert_eq!(
450449
original.partition(),
451450
roundtrip.partition(),
452-
"partition mismatch in {}",
453-
test_name
451+
"partition mismatch in {test_name}"
454452
);
455453

456454
assert_eq!(
457455
original.labels().len(),
458456
roundtrip.labels().len(),
459-
"label count mismatch in {}",
460-
test_name
457+
"label count mismatch in {test_name}"
461458
);
462459

463460
for (orig_label, rt_label) in original.labels().iter().zip(roundtrip.labels().iter()) {
464461
assert_eq!(
465462
orig_label.name(),
466463
rt_label.name(),
467-
"label name mismatch in {}",
468-
test_name
464+
"label name mismatch in {test_name}"
469465
);
470466
assert_eq!(
471467
orig_label.value(),
472468
rt_label.value(),
473-
"label value mismatch in {}",
474-
test_name
469+
"label value mismatch in {test_name}"
475470
);
476471
}
477472

src/protobuf/errors/arrow_error.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,7 @@ mod tests {
207207
fn test_arrow_error_roundtrip() {
208208
let test_cases = vec![
209209
ArrowError::NotYetImplemented("test not implemented".to_string()),
210-
ArrowError::ExternalError(Box::new(std::io::Error::new(
211-
ErrorKind::Other,
212-
"external error",
213-
))),
210+
ArrowError::ExternalError(Box::new(std::io::Error::other("external error"))),
214211
ArrowError::CastError("cast error".to_string()),
215212
ArrowError::MemoryError("memory error".to_string()),
216213
ArrowError::ParseError("parse error".to_string()),
@@ -242,8 +239,8 @@ mod tests {
242239
let (recovered_error, recovered_ctx) = proto.to_arrow_error();
243240

244241
if original_error.to_string() != recovered_error.to_string() {
245-
println!("original error: {}", original_error);
246-
println!("recovered error: {}", recovered_error);
242+
println!("original error: {original_error}");
243+
println!("recovered error: {recovered_error}");
247244
}
248245

249246
assert_eq!(original_error.to_string(), recovered_error.to_string());

src/protobuf/errors/datafusion_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ mod tests {
313313
),
314314
DataFusionError::Execution("execution error".to_string()),
315315
DataFusionError::ResourcesExhausted("resources exhausted".to_string()),
316-
DataFusionError::External(Box::new(std::io::Error::new(ErrorKind::Other, "external"))),
316+
DataFusionError::External(Box::new(std::io::Error::other("external"))),
317317
DataFusionError::Context(
318318
"context message".to_string(),
319319
Box::new(DataFusionError::Internal("nested".to_string())),

src/protobuf/errors/objectstore_error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ mod tests {
267267
// Use known store names that will be preserved
268268
ObjectStoreError::Generic {
269269
store: "S3",
270-
source: Box::new(std::io::Error::new(ErrorKind::Other, "generic error")),
270+
source: Box::new(std::io::Error::other("generic error")),
271271
},
272272
ObjectStoreError::NotFound {
273273
path: "test/path".to_string(),
@@ -279,14 +279,14 @@ mod tests {
279279
},
280280
ObjectStoreError::Precondition {
281281
path: "precondition/path".to_string(),
282-
source: Box::new(std::io::Error::new(ErrorKind::Other, "precondition failed")),
282+
source: Box::new(std::io::Error::other("precondition failed")),
283283
},
284284
ObjectStoreError::NotSupported {
285285
source: Box::new(std::io::Error::new(ErrorKind::Unsupported, "not supported")),
286286
},
287287
ObjectStoreError::NotModified {
288288
path: "not/modified".to_string(),
289-
source: Box::new(std::io::Error::new(ErrorKind::Other, "not modified")),
289+
source: Box::new(std::io::Error::other("not modified")),
290290
},
291291
ObjectStoreError::NotImplemented,
292292
ObjectStoreError::PermissionDenied {
@@ -298,7 +298,7 @@ mod tests {
298298
},
299299
ObjectStoreError::Unauthenticated {
300300
path: "auth/path".to_string(),
301-
source: Box::new(std::io::Error::new(ErrorKind::Other, "unauthenticated")),
301+
source: Box::new(std::io::Error::other("unauthenticated")),
302302
},
303303
ObjectStoreError::UnknownConfigurationKey {
304304
key: "unknown_key".to_string(),

src/protobuf/errors/parquet_error.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ mod tests {
104104
ParquetError::EOF("end of file".to_string()),
105105
ParquetError::ArrowError("arrow error".to_string()),
106106
ParquetError::IndexOutOfBound(42, 100),
107-
ParquetError::External(Box::new(std::io::Error::new(
108-
std::io::ErrorKind::Other,
109-
"external error",
110-
))),
107+
ParquetError::External(Box::new(std::io::Error::other("external error"))),
111108
ParquetError::NeedMoreData(1024),
112109
];
113110

src/stage.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,9 @@ pub fn display_plan_graphviz(plan: Arc<dyn ExecutionPlan>) -> Result<String> {
343343
f,
344344
"digraph G {{
345345
rankdir=BT
346-
edge[colorscheme={}, penwidth=2.0]
346+
edge[colorscheme={COLOR_SCHEME}, penwidth=2.0]
347347
splines=false
348-
",
349-
COLOR_SCHEME
348+
"
350349
)?;
351350

352351
if plan.as_any().is::<DistributedExec>() {
@@ -367,7 +366,7 @@ pub fn display_plan_graphviz(plan: Arc<dyn ExecutionPlan>) -> Result<String> {
367366
for stage in &all_stages {
368367
for i in 0..stage.tasks.iter().len() {
369368
let p = display_single_task(stage, i)?;
370-
writeln!(f, "{}", p)?;
369+
writeln!(f, "{p}")?;
371370
}
372371
}
373372
// now draw edges between the tasks
@@ -390,7 +389,7 @@ pub fn display_plan_graphviz(plan: Arc<dyn ExecutionPlan>) -> Result<String> {
390389
// single plan, not a stage tree
391390
writeln!(f, "node[shape=none]")?;
392391
let p = display_plan(&plan, 0, 1, 0)?;
393-
writeln!(f, "{}", p)?;
392+
writeln!(f, "{p}")?;
394393
}
395394

396395
writeln!(f, "}}")?;
@@ -457,7 +456,7 @@ fn display_plan(
457456
while let Some(plan) = queue.pop_front() {
458457
node_index += 1;
459458
let p = display_single_plan(plan.as_ref(), stage_num, task_i, node_index)?;
460-
writeln!(f, "{}", p)?;
459+
writeln!(f, "{p}")?;
461460

462461
if plan.is_network_boundary() {
463462
continue;
@@ -605,7 +604,7 @@ pub fn display_single_plan(
605604
)?;
606605

607606
for i in 0..output_partitions {
608-
writeln!(f, " <TD PORT='t{}'></TD>", i)?;
607+
writeln!(f, " <TD PORT='t{i}'></TD>")?;
609608
}
610609

611610
writeln!(
@@ -631,7 +630,7 @@ pub fn display_single_plan(
631630
)?;
632631

633632
for i in 0..input_partitions {
634-
writeln!(f, " <TD PORT='b{}'></TD>", i)?;
633+
writeln!(f, " <TD PORT='b{i}'></TD>")?;
635634
}
636635

637636
writeln!(

0 commit comments

Comments
 (0)