ckb-rust-std 1.0.0

A collection of `no_std` compatible modules ported from Rust's standard library, with an initial focus on the `io` module.
Documentation
pub const fn memchr(x: u8, text: &[u8]) -> Option<usize> {
    let mut i = 0;
    while i < text.len() {
        if text[i] == x {
            return Some(i);
        }

        i += 1;
    }

    None
}

pub fn memrchr(x: u8, text: &[u8]) -> Option<usize> {
    let mut i = text.len();
    while i > 0 {
        i -= 1;
        if text[i] == x {
            return Some(i);
        }
    }
    None
}