I think the answer is to use unwrap
, but to force it at compile-time:
thread::available_parallelism().unwrap_or(const { NonZeroUsize::new_unchecked(1).unwrap() })
I think the answer is to use unwrap
, but to force it at compile-time:
thread::available_parallelism().unwrap_or(const { NonZeroUsize::new_unchecked(1).unwrap() })