You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
utf8_to_utf16le_bytes creates a temporary vec which we can avoid. We don't need vec allocations for counting or serializing the utf-16 bytes. For example,
let meta_utf16_len = self.metadata.encode_utf16().count()*2;// This would count without allocating// This would serialize UTF-16LE bytes directly to a bufferfnwrite_utf16le_to_buffer(buf:&mutVec<u8>,s:&str){for u in s.encode_utf16(){
buf.extend_from_slice(&u.to_le_bytes());}}