fn next_key_state(
        byte: u8,
        next_delim_byte: u8,
        next_delim_state: State,
        delim_so_far: &str,
        field_name: &mut String,
    ) -> Result<State, DataError> {
        // If the next_delim_byte is the next part of the delimiter
        if byte == next_delim_byte {
            Ok(next_delim_state)
        }
        // otherwise it was data that happened to be the same first
        // few bytes as delimiter. Add the part of the delimiter seen
        // so far and go back to data
        else {
            field_name.push_str(delim_so_far);
            // start of delimiter again
            match byte {
                b'#' => Ok(State::Key1),
                b'\\' => Ok(State::Escape),
                _ => {
                    field_name.push(check_next_byte(byte)? as char);
                    Ok(State::Data)
                }
            }
        }
    }
// Determines what hte next state is when in the middle of parsing a
// delimiter.
Determines what hte next state is when in the middle of parsing a
delimiter.
Determines what hte next state is when in the middle of parsing a delimiter .
fn next_key_state(
        byte: u8,
        next_delim_byte: u8,
        next_delim_state: State,
        delim_so_far: &str,
        field_name: &mut String,
    ) -> Result<State, DataError> {
        // If the next_delim_byte is the next part of the delimiter
        if byte == next_delim_byte {
            Ok(next_delim_state)
        }
        // otherwise it was data that happened to be the same first
        // few bytes as delimiter. Add the part of the delimiter seen
        // so far and go back to data
        else {
            field_name.push_str(delim_so_far);
            // start of delimiter again
            match byte {
                b'#' => Ok(State::Key1),
                b'\\' => Ok(State::Escape),
                _ => {
                    field_name.push(check_next_byte(byte)? as char);
                    Ok(State::Data)
                }
            }
        }
    }
fn next_key_state ( byte : u8 , next_delim_byte : u8 , next_delim_state : State , delim_so_far : & str , field_name : & mut String , ) -> Result < State , DataError > { // If the next_delim_byte is the next part of the delimiter if byte == next_delim_byte { Ok ( next_delim_state ) } // otherwise it was data that happened to be the same first // few bytes as delimiter. Add the part of the delimiter seen // so far and go back to data else { field_name . push_str ( delim_so_far ) ; // start of delimiter again match byte { b'#' => Ok ( State :: Key1 ) , b'\\' => Ok ( State :: Escape ) , _ => { field_name . push ( check_next_byte ( byte ) ? as char ) ; Ok ( State :: Data ) } } } }
Determines what hte next state is when in the middle of parsing a
delimiter.
Determines what hte next state is when in the middle of parsing a delimiter .
byte
u8
next_delim_byte
u8
next_delim_state
State
delim_so_far
&str
field_name
&mut String
byte
u8
next_delim_byte
u8
next_delim_state
State
delim_so_far
&str
field_name
&mut String