mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +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");
|
||||
|
||||
let runnable_vcpu = vcpu.to_runnable(None).unwrap();
|
||||
loop {
|
||||
match runnable_vcpu.run().expect("run failed") {
|
||||
VcpuExit::Hlt => break,
|
||||
r => panic!("unexpected exit reason: {:?}", r),
|
||||
}
|
||||
let run_result = runnable_vcpu.run().expect("run failed");
|
||||
if !matches!(run_result, VcpuExit::Hlt) {
|
||||
panic!("unexpected exit reason: {:?}", run_result);
|
||||
}
|
||||
|
||||
let mut dirty_log = [0x0, 0x0];
|
||||
|
|
Loading…
Reference in a new issue