sysfuss 0.3.0

sysfs wrapper for convenience
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::ffi::OsStr;
use std::os::unix::ffi::OsStrExt;

pub fn starts_with(src: &OsStr, contains: &OsStr) -> bool {
    let src_bytes = src.as_bytes();
    for (index, byte) in contains.as_bytes().iter().enumerate() {
        if src_bytes[index] != *byte {
            return false;
        }
    }
    true
}