mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35: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 {
|
||||
1 | 2 | 4 | 8 => {}
|
||||
_ => {
|
||||
return Err(PlatformError::InvalidOperand(anyhow!(
|
||||
"Invalid operand size {:?}",
|
||||
op_size
|
||||
)))
|
||||
}
|
||||
if !matches!(op_size, 1 | 2 | 4 | 8) {
|
||||
return Err(PlatformError::InvalidOperand(anyhow!(
|
||||
"Invalid operand size {:?}",
|
||||
op_size
|
||||
)));
|
||||
}
|
||||
|
||||
let value = match insn
|
||||
@ -81,14 +78,11 @@ fn set_op<T: CpuStateManager>(
|
||||
)));
|
||||
}
|
||||
|
||||
match op_size {
|
||||
1 | 2 | 4 | 8 => {}
|
||||
_ => {
|
||||
return Err(PlatformError::InvalidOperand(anyhow!(
|
||||
"Invalid operand size {:?}",
|
||||
op_size
|
||||
)))
|
||||
}
|
||||
if !matches!(op_size, 1 | 2 | 4 | 8) {
|
||||
return Err(PlatformError::InvalidOperand(anyhow!(
|
||||
"Invalid operand size {:?}",
|
||||
op_size
|
||||
)));
|
||||
}
|
||||
|
||||
match insn
|
||||
|
Loading…
Reference in New Issue
Block a user