pub fn read_usize<'a>(input: &'a str) -> Result<(&'a str, usize), Box<dyn Error>> {
    let mut boundary = 0;

    for (index, c) in input.char_indices() {
        if !c.is_ascii_digit() {
            boundary = index;
            break;
        }
    }

    let number = input[..boundary].parse::<usize>()?;
    let remainder = &input[boundary..];

    Ok((remainder, number))
}
/// Parse a usize from a string, returning the reamaining string and the usize
Parse a usize from a string, returning the reamaining string and the usize
Parse a usize from a string returning the reamaining string and the usize
pub fn read_usize<'a>(input: &'a str) -> Result<(&'a str, usize), Box<dyn Error>> {
    let mut boundary = 0;
    for (index, c) in input.char_indices() {
        if !c.is_ascii_digit() {
            boundary = index;
            break;
        }
    }
    let number = input[..boundary].parse::<usize>()?;
    let remainder = &input[boundary..];
    Ok((remainder, number))
}
pub fn read_usize < ' a > ( input : & ' a str ) -> Result < ( & ' a str , usize ) , Box < dyn Error > > { let mut boundary = 0 ; for ( index , c ) in input . char_indices ( ) { if ! c . is_ascii_digit ( ) { boundary = index ; break ; } } let number = input [ .. boundary ] . parse :: < usize > ( ) ? ; let remainder = & input [ boundary .. ] ; Ok ( ( remainder , number ) ) }
Parse a usize from a string, returning the reamaining string and the usize
Parse a usize from a string returning the reamaining string and the usize
input
&'a str
input
&'a str