pub fn compute_size(type_string: &str) -> i32 {
    let mut hex_bits = String::new();
    //Index 2 and 3 represent the size
    hex_bits.push(type_string.chars().nth(ARRAY_SIZE_LSB_INDEX).unwrap());
    hex_bits.push(type_string.chars().nth(ARRAY_SIZE_MSB_INDEX).unwrap());
    let bits: std::result::Result<i32, std::num::ParseIntError> =
        i32::from_str_radix(&hex_bits, 32);
    let total_bits: i32 = bits.unwrap();
    let mut length_bits = String::new();
    let index = 4;
    for i in 0..total_bits {
        let iterator = i as usize;
        length_bits.push(type_string.chars().nth(iterator + index).unwrap());
    }
    //Convert size to i32 for integer comparision
    let size: i32 = length_bits.parse().unwrap();
    return size;
}
// Compute total elements present in the data structure
Compute total elements present in the data structure
Compute total elements present in the data structure
pub fn compute_size(type_string: &str) -> i32 {
    let mut hex_bits = String::new();
    //Index 2 and 3 represent the size
    hex_bits.push(type_string.chars().nth(ARRAY_SIZE_LSB_INDEX).unwrap());
    hex_bits.push(type_string.chars().nth(ARRAY_SIZE_MSB_INDEX).unwrap());
    let bits: std::result::Result<i32, std::num::ParseIntError> =
        i32::from_str_radix(&hex_bits, 32);
    let total_bits: i32 = bits.unwrap();
    let mut length_bits = String::new();
    let index = 4;
    for i in 0..total_bits {
        let iterator = i as usize;
        length_bits.push(type_string.chars().nth(iterator + index).unwrap());
    }
    //Convert size to i32 for integer comparision
    let size: i32 = length_bits.parse().unwrap();
    return size;
}
pub fn compute_size ( type_string : & str ) -> i32 { let mut hex_bits = String :: new ( ) ; //Index 2 and 3 represent the size hex_bits . push ( type_string . chars ( ) . nth ( ARRAY_SIZE_LSB_INDEX ) . unwrap ( ) ) ; hex_bits . push ( type_string . chars ( ) . nth ( ARRAY_SIZE_MSB_INDEX ) . unwrap ( ) ) ; let bits : std :: result :: Result < i32 , std :: num :: ParseIntError > = i32 :: from_str_radix ( & hex_bits , 32 ) ; let total_bits : i32 = bits . unwrap ( ) ; let mut length_bits = String :: new ( ) ; let index = 4 ; for i in 0 .. total_bits { let iterator = i as usize ; length_bits . push ( type_string . chars ( ) . nth ( iterator + index ) . unwrap ( ) ) ; } //Convert size to i32 for integer comparision let size : i32 = length_bits . parse ( ) . unwrap ( ) ; return size ; }
Compute total elements present in the data structure
Compute total elements present in the data structure
type_string
&str
type_string
&str