Skip to content

Commit

Permalink
修改了增加虚拟机工厂依赖的接口
Browse files Browse the repository at this point in the history
  • Loading branch information
vmosone committed Jan 9, 2020
1 parent ce7b206 commit 02ee4fe
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/pi_vm_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,11 @@ impl VMFactory {
}

//为指定虚拟机工厂增加指定模块的代码,必须使用所有权,以保证运行时不会不安全的增加代码,复制对象将无法增加代码
pub fn append_module(mut self, module: String, code: Arc<Vec<u8>>) -> Self {
pub fn append_depend(mut self, module: String) -> Self {
match Arc::get_mut(&mut self.mods) {
None => (),
Some(mods) => {
match Arc::get_mut(&mut self.codes) {
None => (),
Some(codes) => {
codes.push(code);
mods.push(module);
}
}
mods.push(module);
},
}
self
Expand Down

0 comments on commit 02ee4fe

Please sign in to comment.