wtf8: use encode_utf8_raw
This commit is contained in:
parent
72d85db6ee
commit
3182cdf9ba
2 changed files with 2 additions and 2 deletions
|
@ -247,6 +247,7 @@
|
|||
#![feature(cfg_target_has_atomic)]
|
||||
#![feature(cfg_target_thread_local)]
|
||||
#![feature(char_error_internals)]
|
||||
#![feature(char_internals)]
|
||||
#![feature(clamp)]
|
||||
#![feature(concat_idents)]
|
||||
#![feature(const_cstr_unchecked)]
|
||||
|
|
|
@ -201,9 +201,8 @@ impl Wtf8Buf {
|
|||
/// Copied from String::push
|
||||
/// This does **not** include the WTF-8 concatenation check.
|
||||
fn push_code_point_unchecked(&mut self, code_point: CodePoint) {
|
||||
let c = unsafe { char::from_u32_unchecked(code_point.value) };
|
||||
let mut bytes = [0; 4];
|
||||
let bytes = c.encode_utf8(&mut bytes).as_bytes();
|
||||
let bytes = char::encode_utf8_raw(code_point.value, &mut bytes).as_bytes();
|
||||
self.bytes.extend_from_slice(bytes)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue