/// Deserialize variable names from binary format.
///
/// Variable names are a 16-bit length-prefixed list of 16-bit length prefixed
/// strings.
/// TODO: Document the protocol properly somewhere.
Deserialize variable names from binary format.
Variable names are a 16-bit length-prefixed list of 16-bit length prefixed
strings.
TODO: Document the protocol properly somewhere.
Deserialize variable names from binary format . Variable names are a 16 - bit length - prefixed list of 16 - bit length prefixed strings . TODO : Document the protocol properly somewhere .
fn parse_strings(cursor: &mut Cursor) -> Result<Vec<String>> {
    let num_variables = cursor.take_u16_le()?;
    let mut variable_names = Vec::with_capacity(num_variables as usize);
    for _ in 0..num_variables {
        let len = cursor.take_u16_le()?;
        let name = cursor.take_utf8(len as usize)?;
        variable_names.push(name.to_string());
    }
    Ok(variable_names)
}
fn parse_strings ( cursor : & mut Cursor ) -> Result < Vec < String > > { let num_variables = cursor . take_u16_le ( ) ? ; let mut variable_names = Vec :: with_capacity ( num_variables as usize ) ; for _ in 0 .. num_variables { let len = cursor . take_u16_le ( ) ? ; let name = cursor . take_utf8 ( len as usize ) ? ; variable_names . push ( name . to_string ( ) ) ; } Ok ( variable_names ) }
Deserialize variable names from binary format.
Deserialize variable names from binary format .
cursor
&mut Cursor