Use slicing syntax instead of .as_slice()

This commit is contained in:
Thomas Bahn
2015-02-06 15:17:24 +01:00
parent 3022d7301a
commit 5dd077969c
13 changed files with 45 additions and 45 deletions
+1 -1
View File
@@ -352,7 +352,7 @@ impl<Iter: Iterator<Item=u8>> Parser<Iter> {
let buf = &mut [0; 4];
let len = c.encode_utf8(buf).unwrap_or(0);
self.buf.extend(buf.slice_to(len).iter().map(|b| *b));
self.buf.extend(buf[..len].iter().map(|b| *b));
}
_ => {
return Err(self.error(ErrorCode::InvalidEscape));