rlibutils 0.1.2

A small collection of utility functions for your rust projects
Documentation
1
2
3
4
5
6
7
use std::thread;

pub fn get_num_cores() -> i32 {
    thread::available_parallelism()
        .map(|n| n.get())
        .unwrap_or(4) as i32
}