Skip to content

Commit 858e166

Browse files
committed
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.
1 parent ff5fdff commit 858e166

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libextra/hex.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ impl<'self> ToHex for &'self [u8] {
3838
* ~~~
3939
*/
4040
fn to_hex(&self) -> ~str {
41-
// +1 for NULL terminator
42-
let mut v = vec::with_capacity(self.len() * 2 + 1);
41+
let mut v = vec::with_capacity(self.len() * 2);
4342
for &byte in self.iter() {
4443
v.push(CHARS[byte >> 4]);
4544
v.push(CHARS[byte & 0xf]);

0 commit comments

Comments
 (0)