fn round_trip_parsing1(char_val: char) {
        let char_box: [char; 1] = [char_val; 1];
        let mut utf8_box: [u8; 4] = [0; 4];
        let mut utf8_len: usize = 0;

        let mut char_ref = & char_box[..];
        let mut utf32_parser = FromUnicode::new();
        loop {
            match utf32_parser.char_to_utf8(char_ref) {
                Result::Ok((char_pos, b)) => {
                    if char_val == char::REPLACEMENT_CHARACTER {
                        assert_eq!(true, utf32_parser.has_invalid_sequence());
                    }
                    utf8_box[utf8_len] = b;
                    utf8_len += 1;
                    char_ref = char_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        let mut utf8_ref = & utf8_box[0 .. utf8_len];
        let mut char_box2: [char; 1] = [char::MAX; 1];
        let mut char_len: usize = 0;
        let mut utf8_parser = FromUtf8::new();
        loop {
            match utf8_parser.utf8_to_char(utf8_ref) {
                Result::Ok((utf8_pos, ch)) => {
                    if char_val == char::REPLACEMENT_CHARACTER {
                        assert_eq!(true, utf8_parser.has_invalid_sequence());
                    }
                    char_box2[char_len] = ch;
                    char_len += 1;
                    utf8_ref = utf8_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        assert_eq!(1, char_len);
        assert_eq!(char_val, char_box2[0]);
    }
// Have a char value go through a round trip of conversions.

Have a char value go through a round trip of conversions.
Have a char value go through a round trip of conversions .
fn round_trip_parsing1(char_val: char) {
        let char_box: [char; 1] = [char_val; 1];
        let mut utf8_box: [u8; 4] = [0; 4];
        let mut utf8_len: usize = 0;
        let mut char_ref = & char_box[..];
        let mut utf32_parser = FromUnicode::new();
        loop {
            match utf32_parser.char_to_utf8(char_ref) {
                Result::Ok((char_pos, b)) => {
                    if char_val == char::REPLACEMENT_CHARACTER {
                        assert_eq!(true, utf32_parser.has_invalid_sequence());
                    }
                    utf8_box[utf8_len] = b;
                    utf8_len += 1;
                    char_ref = char_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        let mut utf8_ref = & utf8_box[0 .. utf8_len];
        let mut char_box2: [char; 1] = [char::MAX; 1];
        let mut char_len: usize = 0;
        let mut utf8_parser = FromUtf8::new();
        loop {
            match utf8_parser.utf8_to_char(utf8_ref) {
                Result::Ok((utf8_pos, ch)) => {
                    if char_val == char::REPLACEMENT_CHARACTER {
                        assert_eq!(true, utf8_parser.has_invalid_sequence());
                    }
                    char_box2[char_len] = ch;
                    char_len += 1;
                    utf8_ref = utf8_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        assert_eq!(1, char_len);
        assert_eq!(char_val, char_box2[0]);
    }
fn round_trip_parsing1 ( char_val : char ) { let char_box : [ char ; 1 ] = [ char_val ; 1 ] ; let mut utf8_box : [ u8 ; 4 ] = [ 0 ; 4 ] ; let mut utf8_len : usize = 0 ; let mut char_ref = & char_box [ .. ] ; let mut utf32_parser = FromUnicode :: new ( ) ; loop { match utf32_parser . char_to_utf8 ( char_ref ) { Result :: Ok ( ( char_pos , b ) ) => { if char_val == char :: REPLACEMENT_CHARACTER { assert_eq ! ( true utf32_parser has_invalid_sequence ( ) ) ; } utf8_box [ utf8_len ] = b ; utf8_len += 1 ; char_ref = char_pos ; } Result :: Err ( MoreEnum :: More ( _ ) ) => { break ; } } } let mut utf8_ref = & utf8_box [ 0 .. utf8_len ] ; let mut char_box2 : [ char ; 1 ] = [ char :: MAX ; 1 ] ; let mut char_len : usize = 0 ; let mut utf8_parser = FromUtf8 :: new ( ) ; loop { match utf8_parser . utf8_to_char ( utf8_ref ) { Result :: Ok ( ( utf8_pos , ch ) ) => { if char_val == char :: REPLACEMENT_CHARACTER { assert_eq ! ( true utf8_parser has_invalid_sequence ( ) ) ; } char_box2 [ char_len ] = ch ; char_len += 1 ; utf8_ref = utf8_pos ; } Result :: Err ( MoreEnum :: More ( _ ) ) => { break ; } } } assert_eq ! ( 1 char_len ) ; assert_eq ! ( char_val char_box2 [ 0 ] ) ; }
Have a char value go through a round trip of conversions.
Have a char value go through a round trip of conversions .
char_val
char
char_val
char