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:
Steven Fackler 2013-08-05 00:08:13 -04:00
parent ff5fdffc13
commit 858e166119

View File

@ -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]);