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:
Wei Liu 2020-11-26 11:24:07 +00:00 committed by LIU Wei
parent c8b655490e
commit c6aea5af5d

View File

@ -52,7 +52,7 @@ pub trait InstructionHandler<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> {
@ -67,7 +67,7 @@ impl<T: CpuStateManager> InstructionMap<T> {
insn: Code,
insn_handler: Box<dyn InstructionHandler<T> + Sync + Send>,
) {
self.instructions.insert(insn, Box::new(insn_handler));
self.instructions.insert(insn, insn_handler);
}
}