1- pub use std:: thread:: { current, sleep, Result , Thread , ThreadId } ;
21use std:: {
32 cell:: UnsafeCell ,
43 fmt,
@@ -7,6 +6,7 @@ use std::{
76 panic:: { catch_unwind, AssertUnwindSafe } ,
87 rc:: Rc ,
98 sync:: { Arc , Mutex } ,
9+ thread:: { Result , Thread } ,
1010} ;
1111
1212use scoped:: ScopeData ;
@@ -280,29 +280,29 @@ impl Builder {
280280 let script = worker_script_url. unwrap_or ( get_worker_script ( wasm_bindgen_shim_url) ) ;
281281
282282 // Todo: figure out how to set stack size
283- let mut options = WorkerOptions :: new ( ) ;
283+ let options = WorkerOptions :: new ( ) ;
284284 match ( name, prefix) {
285285 ( Some ( name) , Some ( prefix) ) => {
286- options. name ( & format ! ( "{}:{}" , prefix, name) ) ;
286+ options. set_name ( & format ! ( "{}:{}" , prefix, name) ) ;
287287 }
288288 ( Some ( name) , None ) => {
289- options. name ( & name) ;
289+ options. set_name ( & name) ;
290290 }
291291 ( None , Some ( prefix) ) => {
292292 let random = ( js_sys:: Math :: random ( ) * 10e10 ) as u64 ;
293- options. name ( & format ! ( "{}:{}" , prefix, random) ) ;
293+ options. set_name ( & format ! ( "{}:{}" , prefix, random) ) ;
294294 }
295295 ( None , None ) => { }
296296 } ;
297297
298298 #[ cfg( feature = "es_modules" ) ]
299299 {
300300 js_sys:: eval ( include_str ! ( "js/module_workers_polyfill.min.js" ) ) . unwrap ( ) ;
301- options. type_ ( WorkerType :: Module ) ;
301+ options. set_type ( WorkerType :: Module ) ;
302302 }
303303 #[ cfg( not( feature = "es_modules" ) ) ]
304304 {
305- options. type_ ( WorkerType :: Classic ) ;
305+ options. set_type ( WorkerType :: Classic ) ;
306306 }
307307
308308 // Spawn the worker
0 commit comments