From c6aea5af5d9d6c51368cb7997f02d86799fbe75b Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 26 Nov 2020 11:24:07 +0000 Subject: [PATCH] hypervisor: x86: drop an extraneous box indirection There is no need to put a box into another box. Signed-off-by: Wei Liu --- hypervisor/src/arch/x86/emulator/instructions/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypervisor/src/arch/x86/emulator/instructions/mod.rs b/hypervisor/src/arch/x86/emulator/instructions/mod.rs index b7051270f..ad74b49fe 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/mod.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/mod.rs @@ -52,7 +52,7 @@ pub trait InstructionHandler { } pub struct InstructionMap { - pub instructions: HashMap + Sync + Send>>>, + pub instructions: HashMap + Sync + Send>>, } impl InstructionMap { @@ -67,7 +67,7 @@ impl InstructionMap { insn: Code, insn_handler: Box + Sync + Send>, ) { - self.instructions.insert(insn, Box::new(insn_handler)); + self.instructions.insert(insn, insn_handler); } }