We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayString::try_push(c: char)
Currently it encodes the character to utf8 in anyway instead of memcpy for ascii characters. Although String::push has some optimizations.
memcpy
String::push
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()), } }
The text was updated successfully, but these errors were encountered:
ArrayString::push(c: char)
No branches or pull requests
Currently it encodes the character to utf8 in anyway instead of
memcpy
for ascii characters. AlthoughString::push
has some optimizations.https://doc.rust-lang.org/std/string/struct.String.html#method.push
The text was updated successfully, but these errors were encountered: