fn take_response_code(b: &[u8]) -> IResult<&[u8], &[u8]> {
    let res: IResult<_, (char, char, char)> =
        tuple((one_of("12345"), one_of_digit, one_of_digit))(b);
    let (rest, _) = res?;

    Ok((rest, &b[0..3]))
}
/// Takes a response code from the buffer
///
/// A valid response code is three ASCII digits where the first digit is between 1 and 5
Takes a response code from the buffer
A valid response code is three ASCII digits where the first digit is between 1 and 5
Takes a response code from the buffer A valid response code is three ASCII digits where the first digit is between 1 and 5
fn take_response_code(b: &[u8]) -> IResult<&[u8], &[u8]> {
    let res: IResult<_, (char, char, char)> =
        tuple((one_of("12345"), one_of_digit, one_of_digit))(b);
    let (rest, _) = res?;
    Ok((rest, &b[0..3]))
}
fn take_response_code ( b : & [ u8 ] ) -> IResult < & [ u8 ] , & [ u8 ] > { let res : IResult < _ , ( char , char , char ) > = tuple ( ( one_of ( " " ) , one_of_digit , one_of_digit ) ) ( b ) ; let ( rest , _ ) = res ? ; Ok ( ( rest , & b [ 0 .. 3 ] ) ) }
Takes a response code from the buffer
A valid response code is three ASCII digits where the first digit is between 1 and 5
Takes a response code from the buffer A valid response code is three ASCII digits where the first digit is between 1 and 5
b
&[u8]