mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-28 01:16:50 +00:00
kvm/tests: fix clippy::never_loop
This loop always ran exactly once, so it doesn't need to be a loop. BUG=b:344974550 TEST=tools/clippy Change-Id: I6fe2620d4ba712b573515122720caeafc44081cf Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609075 Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
cf5d251863
commit
50dd3cae44
1 changed files with 3 additions and 5 deletions
|
@ -62,11 +62,9 @@ fn test_run() {
|
||||||
.expect("failed to register memory");
|
.expect("failed to register memory");
|
||||||
|
|
||||||
let runnable_vcpu = vcpu.to_runnable(None).unwrap();
|
let runnable_vcpu = vcpu.to_runnable(None).unwrap();
|
||||||
loop {
|
let run_result = runnable_vcpu.run().expect("run failed");
|
||||||
match runnable_vcpu.run().expect("run failed") {
|
if !matches!(run_result, VcpuExit::Hlt) {
|
||||||
VcpuExit::Hlt => break,
|
panic!("unexpected exit reason: {:?}", run_result);
|
||||||
r => panic!("unexpected exit reason: {:?}", r),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut dirty_log = [0x0, 0x0];
|
let mut dirty_log = [0x0, 0x0];
|
||||||
|
|
Loading…
Reference in a new issue