8000 Update vm_class.rs · RustPython/RustPython@5192b37 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5192b37

Browse files
committed
Update vm_class.rs
1 parent 5384a47 commit 5192b37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

wasm/lib/src/vm_class.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ fn init_window_module(vm: &VirtualMachine) -> PyRef<PyModule> {
3939
}
4040

4141
impl StoredVirtualMachine {
42-
fn new(id: String, inject_browser_module: bool) -> StoredVirtualMachine {
42+
fn new<I>(id: String, inject_browser_module: bool, iter: I) -> StoredVirtualMachine where
43+
I: IntoIterator<Item = (Cow<'static, str>, stdlib::StdlibInitFunc)> {
4344
let mut scope = None;
4445
let mut settings = Settings::default();
4546
settings.allow_external_library = false;
@@ -113,7 +114,8 @@ pub struct VMStore;
113114

114115
#[wasm_bindgen(js_class = vmStore)]
115116
impl VMStore {
116-
pub fn init(id: String, inject_browser_module: Option<bool>) -> WASMVirtualMachine {
117+
pub fn init<i>(id: String, inject_browser_module: Option<bool>, iter: I) -> WASMVirtualMachine where
118+
I: IntoIterator<Item = (Cow<'static, str>, stdlib::StdlibInitFunc)>{
117119
STORED_VMS.with(|cell| {
118120
let mut vms = cell.borrow_mut();
119121
if !vms.contains_key(&id) {

0 commit comments

Comments
 (0)
0