Removing space for NULL terminator
String NULL terminators are going away soon, so we may as well get rid of this now so it doesn't rot.
This commit is contained in:
parent
ff5fdffc13
commit
858e166119
@ -38,8 +38,7 @@ impl<'self> ToHex for &'self [u8] {
|
||||
* ~~~
|
||||
*/
|
||||
fn to_hex(&self) -> ~str {
|
||||
// +1 for NULL terminator
|
||||
let mut v = vec::with_capacity(self.len() * 2 + 1);
|
||||
let mut v = vec::with_capacity(self.len() * 2);
|
||||
for &byte in self.iter() {
|
||||
v.push(CHARS[byte >> 4]);
|
||||
v.push(CHARS[byte & 0xf]);
|
||||
|
Loading…
Reference in New Issue
Block a user