File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ pub mod raw;
28
28
pub ( crate ) mod units;
29
29
30
30
pub fn io_thread_count ( ) -> usize {
31
- // Don't spawn more than this many I/O threads unless the user tells us to.
32
- // Feel free to increase this value if it improves performance .
33
- const DEFAULT_IO_THREAD_LIMIT : usize = 8 ;
34
-
35
- thread :: available_parallelism ( )
36
- . map_or ( 1 , |p| p . get ( ) )
37
- . min ( DEFAULT_IO_THREAD_LIMIT )
31
+ match thread :: available_parallelism ( ) {
32
+ // Don't spawn more than 8 I/O threads unless the user tells us to .
33
+ // Feel free to increase this value if it improves performance.
34
+ Ok ( threads ) => Ord :: min ( threads . get ( ) , 8 ) ,
35
+ // Unknown for target platform or no permission to query.
36
+ Err ( _ ) => 1 ,
37
+ }
38
38
}
39
39
40
40
#[ must_use]
You can’t perform that action at this time.
0 commit comments