mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 17:11:02 +00:00
Fix: Utf16 handling moved from std into unicode crate
Following a rust change.
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
use std::str;
|
use std::str;
|
||||||
use std::num::Float;
|
use std::num::Float;
|
||||||
use std::str::ScalarValue;
|
use unicode::str::Utf16Item;
|
||||||
use std::char;
|
use std::char;
|
||||||
|
|
||||||
use de;
|
use de;
|
||||||
@@ -379,8 +379,8 @@ impl<Iter: Iterator<u8>> Parser<Iter> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let buf = &[n1, try!(self.decode_hex_escape())];
|
let buf = &[n1, try!(self.decode_hex_escape())];
|
||||||
match str::utf16_items(buf.as_slice()).next() {
|
match ::unicode::str::utf16_items(buf.as_slice()).next() {
|
||||||
Some(ScalarValue(c)) => c,
|
Some(Utf16Item::ScalarValue(c)) => c,
|
||||||
_ => {
|
_ => {
|
||||||
return Err(self.error(ErrorCode::LoneLeadingSurrogateInHexEscape));
|
return Err(self.error(ErrorCode::LoneLeadingSurrogateInHexEscape));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ extern crate serde_macros;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
extern crate serialize;
|
extern crate serialize;
|
||||||
|
|
||||||
|
extern crate unicode;
|
||||||
|
|
||||||
pub use de::{Deserializer, Deserialize};
|
pub use de::{Deserializer, Deserialize};
|
||||||
pub use ser::{Serializer, Serialize};
|
pub use ser::{Serializer, Serialize};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user