mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
hypervisor: emulator: use matches!
No functional change. Just make the code a bit nicer to read. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
92f559f6f2
commit
2f514523dd
@ -28,14 +28,11 @@ fn get_op<T: CpuStateManager>(
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
match op_size {
|
if !matches!(op_size, 1 | 2 | 4 | 8) {
|
||||||
1 | 2 | 4 | 8 => {}
|
return Err(PlatformError::InvalidOperand(anyhow!(
|
||||||
_ => {
|
"Invalid operand size {:?}",
|
||||||
return Err(PlatformError::InvalidOperand(anyhow!(
|
op_size
|
||||||
"Invalid operand size {:?}",
|
)));
|
||||||
op_size
|
|
||||||
)))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let value = match insn
|
let value = match insn
|
||||||
@ -81,14 +78,11 @@ fn set_op<T: CpuStateManager>(
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
match op_size {
|
if !matches!(op_size, 1 | 2 | 4 | 8) {
|
||||||
1 | 2 | 4 | 8 => {}
|
return Err(PlatformError::InvalidOperand(anyhow!(
|
||||||
_ => {
|
"Invalid operand size {:?}",
|
||||||
return Err(PlatformError::InvalidOperand(anyhow!(
|
op_size
|
||||||
"Invalid operand size {:?}",
|
)));
|
||||||
op_size
|
|
||||||
)))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
match insn
|
match insn
|
||||||
|
Loading…
Reference in New Issue
Block a user