Skip to content

Commit 70e3dde

Browse files
author
Auto Merge Bot
committed
fix: Fix formatting issues in startup_optimizer module
- Move startup_optimizer module to correct alphabetical order in mod.rs - Fix line length formatting in startup_optimizer.rs - Add trailing newline at end of file This fixes the cargo fmt check failure that was blocking PR #490.
1 parent 09137eb commit 70e3dde

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

orchestrator/src/vm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ pub mod reliability;
2929
pub mod resource_limits;
3030
pub mod rootfs;
3131
pub mod seccomp;
32-
pub mod startup_optimizer;
3332
pub mod security_escape_simple;
3433
pub mod security_integration_tests;
3534
// pub mod security_validation;
3635
pub mod snapshot;
36+
pub mod startup_optimizer;
3737
#[cfg(unix)]
3838
pub mod vsock;
3939

orchestrator/src/vm/startup_optimizer.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ impl PerformanceTracker {
312312
let min_time_ms = sorted_times.first().copied().unwrap_or(0.0);
313313
let max_time_ms = sorted_times.last().copied().unwrap_or(0.0);
314314
let p95_index = ((sample_count as f64) * 0.95) as usize;
315-
let p95_time_ms = sorted_times.get(p95_index.min(sample_count - 1)).copied().unwrap_or(0.0);
315+
let p95_time_ms = sorted_times
316+
.get(p95_index.min(sample_count - 1))
317+
.copied()
318+
.unwrap_or(0.0);
316319

317320
// Calculate average phases
318321
let mut avg_phases = StartupPhases::new();
@@ -613,4 +616,4 @@ mod tests {
613616
// Both should point to the same tracker instance
614617
assert!(std::ptr::eq(tracker1 as *const _, tracker2 as *const _));
615618
}
616-
}
619+
}

0 commit comments

Comments
 (0)