mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-04 04:25:45 +00:00
hypervisor: x86: drop an extraneous box indirection
There is no need to put a box into another box. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
c8b655490e
commit
c6aea5af5d
@ -52,7 +52,7 @@ pub trait InstructionHandler<T: CpuStateManager> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct InstructionMap<T: CpuStateManager> {
|
pub struct InstructionMap<T: CpuStateManager> {
|
||||||
pub instructions: HashMap<Code, Box<Box<dyn InstructionHandler<T> + Sync + Send>>>,
|
pub instructions: HashMap<Code, Box<dyn InstructionHandler<T> + Sync + Send>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: CpuStateManager> InstructionMap<T> {
|
impl<T: CpuStateManager> InstructionMap<T> {
|
||||||
@ -67,7 +67,7 @@ impl<T: CpuStateManager> InstructionMap<T> {
|
|||||||
insn: Code,
|
insn: Code,
|
||||||
insn_handler: Box<dyn InstructionHandler<T> + Sync + Send>,
|
insn_handler: Box<dyn InstructionHandler<T> + Sync + Send>,
|
||||||
) {
|
) {
|
||||||
self.instructions.insert(insn, Box::new(insn_handler));
|
self.instructions.insert(insn, insn_handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user