From 858e166119d81e76b8909da880b3b3d0e25718c3 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 5 Aug 2013 00:08:13 -0400 Subject: [PATCH] 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. --- src/libextra/hex.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libextra/hex.rs b/src/libextra/hex.rs index 748d0391588..ddd1276a987 100644 --- a/src/libextra/hex.rs +++ b/src/libextra/hex.rs @@ -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]); -- 2.44.0