/// encode writes the UTF-8 encoding of the start and end of this range
/// to the corresponding destination slices.
///
/// The slices should have room for at least `MAX_UTF8_BYTES`.
encode writes the UTF-8 encoding of the start and end of this range
to the corresponding destination slices.

The slices should have room for at least `MAX_UTF8_BYTES`.
encode writes the UTF - 8 encoding of the start and end of this range to the corresponding destination slices . The slices should have room for at least ` MAX_UTF8_BYTES ` .
fn encode(&self, start: &mut [u8], end: &mut [u8]) -> usize {
        let cs = char::from_u32(self.start).unwrap();
        let ce = char::from_u32(self.end).unwrap();
        let n = encode_utf8(cs, start).unwrap();
        let m = encode_utf8(ce, end).unwrap();
        assert_eq!(n, m);
        n
    }
fn encode ( & self , start : & mut [ u8 ] , end : & mut [ u8 ] ) -> usize { let cs = char :: from_u32 ( self . start ) . unwrap ( ) ; let ce = char :: from_u32 ( self . end ) . unwrap ( ) ; let n = encode_utf8 ( cs , start ) . unwrap ( ) ; let m = encode_utf8 ( ce , end ) . unwrap ( ) ; assert_eq ! ( n m ) ; n }
encode writes the UTF-8 encoding of the start and end of this range
to the corresponding destination slices.
encode writes the UTF - 8 encoding of the start and end of this range to the corresponding destination slices .
&self
start
&mut [u8]
end
&mut [u8]