File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1515// specific language governing permissions and limitations
1616// under the License.
1717
18+ use std:: mem:: size_of_val;
1819use std:: sync:: Arc ;
1920
2021use crate :: io:: FileIO ;
Original file line number Diff line number Diff line change 1515// specific language governing permissions and limitations
1616// under the License.
1717
18- use std:: num:: NonZero ;
18+ use std:: num:: NonZeroUsize ;
1919
2020// Use a default value of 1 as the safest option.
2121// See https://doc.rust-lang.org/std/thread/fn.available_parallelism.html#limitations
@@ -31,12 +31,12 @@ const DEFAULT_PARALLELISM: usize = 1;
3131/// are circumstances where the level of available
3232/// parallelism can change during the lifetime of an executing
3333/// 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 {
3535 std:: thread:: available_parallelism ( ) . unwrap_or_else ( |_err| {
3636 // Failed to get the level of parallelism.
3737 // TODO: log/trace when this fallback occurs.
3838
3939 // Using a default value.
40- NonZero :: new ( DEFAULT_PARALLELISM ) . unwrap ( )
40+ NonZeroUsize :: new ( DEFAULT_PARALLELISM ) . unwrap ( )
4141 } )
4242}
You can’t perform that action at this time.
0 commit comments