fn prepare_string_buffer(
    values: usize
) -> Vec<u8> {

    let mut rng = rand::thread_rng();
    let mut buffer: Vec<u8> = Vec::new();
    let between = Range::new( 65, 90 );
    while buffer.len() < values  {
        let character: u8 = between.ind_sample( &mut rng ) as u8;
        assert!( character > 0 );

        // Uncomment to test with invalid UTF-8 string.
        // if buffer.len() == 500 { buffer.push( 0x80 ); }


        buffer.push( character );
    }
    buffer.push( 0 );
    return buffer;
}
/// Prepares an ASCII string buffer for the tests.
Prepares an ASCII string buffer for the tests.
Prepares an ASCII string buffer for the tests .
fn prepare_string_buffer(
    values: usize
) -> Vec<u8> {
    let mut rng = rand::thread_rng();
    let mut buffer: Vec<u8> = Vec::new();
    let between = Range::new( 65, 90 );
    while buffer.len() < values  {
        let character: u8 = between.ind_sample( &mut rng ) as u8;
        assert!( character > 0 );
        // Uncomment to test with invalid UTF-8 string.
        // if buffer.len() == 500 { buffer.push( 0x80 ); }
        buffer.push( character );
    }
    buffer.push( 0 );
    return buffer;
}
fn prepare_string_buffer ( values : usize ) -> Vec < u8 > { let mut rng = rand :: thread_rng ( ) ; let mut buffer : Vec < u8 > = Vec :: new ( ) ; let between = Range :: new ( 65 , 90 ) ; while buffer . len ( ) < values { let character : u8 = between . ind_sample ( & mut rng ) as u8 ; assert ! ( character 0 ) ; // Uncomment to test with invalid UTF-8 string. // if buffer.len() == 500 { buffer.push( 0x80 ); } buffer . push ( character ) ; } buffer . push ( 0 ) ; return buffer ; }
Prepares an ASCII string buffer for the tests.
Prepares an ASCII string buffer for the tests .
values
usize
values
usize