sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
#[cfg(feature = "system")]
pub(crate) fn to_u64(value: &[u8]) -> u64 {
    let mut result = 0;

    for byte in value {
        result *= 10;
        result += u64::from(byte - b'0');
    }
    result
}

/// Converts a path to a NUL-terminated byte vector suitable for C functions.
#[cfg(feature = "disk")]
pub(crate) fn to_cpath(path: &std::path::Path) -> Vec<u8> {
    use std::ffi::OsStr;
    use std::os::unix::ffi::OsStrExt;

    let path_os: &OsStr = path.as_ref();
    let mut cpath = path_os.as_bytes().to_vec();
    cpath.push(0);
    cpath
}