-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
Currently it encodes the character to utf8 in anyway instead of memcpy for ascii characters. Although String::push has some optimizations.
https://doc.rust-lang.org/std/string/struct.String.html#method.push
pub fn push(&mut self, ch: char) {
match ch.len_utf8() {
1 => self.vec.push(ch as u8),
_ => self.vec.extend_from_slice(ch.encode_utf8(&mut [0; 4]).as_bytes()),
}
}bluss
Metadata
Metadata
Assignees
Labels
No labels