kernel: main: use iterator when printing processes

This avoids a C-style for() loop.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-03-23 19:42:33 +08:00
parent 6987df997d
commit ccc7264b79

View file

@ -168,8 +168,10 @@ pub extern "C" fn kmain() {
#[cfg(feature = "debug-print")]
SystemServices::with(|system_services| {
for test_idx in 0..system_services.processes.len() {
println!("{:?}", system_services.processes[test_idx]);
for (test_idx, process) in system_services.processes.iter().enumerate() {
if ! process.free() {
println!("PID {}: {:?}", test_idx + 1, process);
}
}
});