mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-23 05:58:01 +00:00
Use deref coercions when possible
This commit is contained in:
+2
-2
@@ -381,7 +381,7 @@ impl<Iter: Iterator<Item=u8>> Parser<Iter> {
|
||||
}
|
||||
|
||||
let buf = &[n1, try!(self.decode_hex_escape())];
|
||||
match ::unicode::str::utf16_items(buf.as_slice()).next() {
|
||||
match ::unicode::str::utf16_items(buf).next() {
|
||||
Some(Utf16Item::ScalarValue(c)) => c,
|
||||
_ => {
|
||||
return Err(self.error(ErrorCode::LoneLeadingSurrogateInHexEscape));
|
||||
@@ -410,7 +410,7 @@ impl<Iter: Iterator<Item=u8>> Parser<Iter> {
|
||||
match ch {
|
||||
b'"' => {
|
||||
self.bump();
|
||||
return Ok(str::from_utf8(self.buf.as_slice()).unwrap());
|
||||
return Ok(str::from_utf8(&self.buf).unwrap());
|
||||
}
|
||||
b'\\' => {
|
||||
escape = true;
|
||||
|
||||
Reference in New Issue
Block a user