File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 15
15
// specific language governing permissions and limitations
16
16
// under the License.
17
17
18
+ use std:: mem:: size_of_val;
18
19
use std:: sync:: Arc ;
19
20
20
21
use crate :: io:: FileIO ;
Original file line number Diff line number Diff line change 15
15
// specific language governing permissions and limitations
16
16
// under the License.
17
17
18
- use std:: num:: NonZero ;
18
+ use std:: num:: NonZeroUsize ;
19
19
20
20
// Use a default value of 1 as the safest option.
21
21
// See https://doc.rust-lang.org/std/thread/fn.available_parallelism.html#limitations
@@ -31,12 +31,12 @@ const DEFAULT_PARALLELISM: usize = 1;
31
31
/// are circumstances where the level of available
32
32
/// parallelism can change during the lifetime of an executing
33
33
/// process, but this should not be called in a hot loop.
34
- pub ( crate ) fn available_parallelism ( ) -> NonZero < usize > {
34
+ pub ( crate ) fn available_parallelism ( ) -> NonZeroUsize {
35
35
std:: thread:: available_parallelism ( ) . unwrap_or_else ( |_err| {
36
36
// Failed to get the level of parallelism.
37
37
// TODO: log/trace when this fallback occurs.
38
38
39
39
// Using a default value.
40
- NonZero :: new ( DEFAULT_PARALLELISM ) . unwrap ( )
40
+ NonZeroUsize :: new ( DEFAULT_PARALLELISM ) . unwrap ( )
41
41
} )
42
42
}
You can’t perform that action at this time.
0 commit comments