File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,17 @@ pub fn init_runtime () -> std::io::Result<Runtime> {
9090 . enable_io ( )
9191 . build ( )
9292 } else {
93- let mut worker_threads = worker_threads. as_u64 ( ) . unwrap_or ( 1 ) as usize ;
94- if worker_threads == 0 { worker_threads = 1 }
95- Builder :: new_multi_thread ( )
96- . thread_name ( "librespeed-rs" )
97- . worker_threads ( worker_threads)
98- . enable_time ( )
99- . enable_io ( )
100- . build ( )
93+ let worker_threads = worker_threads. as_u64 ( ) . unwrap_or ( 1 ) as usize ;
94+ match worker_threads {
95+ 0 | 1 => Builder :: new_current_thread ( )
96+ . enable_io ( )
97+ . build ( ) ,
98+ _ => Builder :: new_multi_thread ( )
99+ . thread_name ( "librespeed-rs" )
100+ . worker_threads ( worker_threads)
101+ . enable_io ( )
102+ . build ( ) ,
103+ }
101104 }
102105}
103106
You can’t perform that action at this time.
0 commit comments