Skip to content

Commit ea5f187

Browse files
committed
Fix CI clippy warnings
1 parent f31f708 commit ea5f187

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/paper_bench/harness.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,6 @@ fn run_sustained_system(
23542354

23552355
let live_start_at;
23562356
let mut external_join_latencies = Vec::<(i64, f64)>::new();
2357-
let mut live_rows_count = 0;
23582357
let historical_baseline;
23592358

23602359
let estimated_external_transfer_bytes_total;
@@ -2496,8 +2495,6 @@ fn run_sustained_system(
24962495
if win_end <= horizon_end_ms {
24972496
all_live_rows.push(rows.clone());
24982497
}
2499-
live_rows_count += 1;
2500-
25012498
let start_join = Instant::now();
25022499
let joined = join_live_with_baseline(&[rows], &materialized_baseline_rows);
25032500
let join_duration = start_join.elapsed().as_secs_f64() * 1000.0;
@@ -2545,9 +2542,7 @@ fn run_sustained_system(
25452542
if win_end <= horizon_end_ms {
25462543
all_live_rows.push(rows.clone());
25472544
}
2548-
live_rows_count += 1;
2549-
2550-
let start_join = Instant::now();
2545+
let start_join = Instant::now();
25512546
let joined = join_live_with_baseline(&[rows], &materialized_baseline_rows);
25522547
let join_duration = start_join.elapsed().as_secs_f64() * 1000.0;
25532548
if first_hybrid_result_at == 0 {
@@ -2636,7 +2631,9 @@ fn run_sustained_system(
26362631
};
26372632

26382633
let estimated_external_transfer_bytes_per_window = if completed_windows_in_horizon > 0 {
2639-
estimated_external_transfer_bytes_total / completed_windows_in_horizon
2634+
estimated_external_transfer_bytes_total
2635+
.checked_div(completed_windows_in_horizon)
2636+
.unwrap_or(0)
26402637
} else {
26412638
0
26422639
};

src/paper_bench/query_defined_baseline.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ fn collect_live_results(
14471447
first_event_started: Instant,
14481448
expected_results: usize,
14491449
) -> Result<Vec<TimedBinding>, Box<dyn std::error::Error>> {
1450-
let deadline = Instant::now() + Duration::from_secs(600);
1450+
let deadline = Instant::now() + Duration::from_secs(10 * 60);
14511451
let mut timed_results = Vec::new();
14521452
let mut last_progress = Instant::now();
14531453

@@ -1485,8 +1485,8 @@ fn collect_live_results(
14851485
fn expected_live_averages(live_events: &[RDFEvent]) -> HashMap<String, f64> {
14861486
let mut by_sensor: HashMap<String, (f64, usize)> = HashMap::new();
14871487
for event in live_events {
1488-
let sensor = normalize_binding_term(&event.subject.to_string());
1489-
let value = event.object.to_string().trim().parse::<f64>().unwrap_or(0.0);
1488+
let sensor = normalize_binding_term(&event.subject.clone());
1489+
let value = event.object.clone().trim().parse::<f64>().unwrap_or(0.0);
14901490
let entry = by_sensor.entry(sensor).or_insert((0.0, 0));
14911491
entry.0 += value;
14921492
entry.1 += 1;

src/stream_bus/stream_bus.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,14 @@ impl StreamBus {
308308
F: Fn(RDFEvent, String) -> Fut + Send + Sync,
309309
Fut: std::future::Future<Output = ()> + Send,
310310
{
311-
let interval = if self.config.rate_of_publishing > 0 {
312-
Some(Duration::from_micros(1_000_000 / self.config.rate_of_publishing))
313-
} else {
311+
let interval = if self.config.rate_of_publishing == 0 {
314312
None
313+
} else {
314+
Some(Duration::from_micros(
315+
1_000_000u64
316+
.checked_div(self.config.rate_of_publishing)
317+
.expect("rate_of_publishing is positive"),
318+
))
315319
};
316320

317321
let mut last_report = Instant::now();

0 commit comments

Comments
 (0)