Fix: Utf16 handling moved from std into unicode crate
Following a rust change.
This commit is contained in:
parent
17ffa65cb2
commit
a276ec4bba
@ -1,6 +1,6 @@
|
||||
use std::char;
|
||||
use std::num::Float;
|
||||
use std::str::ScalarValue;
|
||||
use unicode::str::Utf16Item;
|
||||
use std::str;
|
||||
|
||||
use de;
|
||||
@ -337,8 +337,8 @@ impl<Iter: Iterator<u8>> Parser<Iter> {
|
||||
}
|
||||
|
||||
let buf = &[n1, try!(self.decode_hex_escape())];
|
||||
match str::utf16_items(buf.as_slice()).next() {
|
||||
Some(ScalarValue(c)) => c,
|
||||
match ::unicode::str::utf16_items(buf.as_slice()).next() {
|
||||
Some(Utf16Item::ScalarValue(c)) => c,
|
||||
_ => {
|
||||
return Err(self.error(ErrorCode::LoneLeadingSurrogateInHexEscape));
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
#![feature(macro_rules)]
|
||||
|
||||
extern crate unicode;
|
||||
|
||||
pub use ser::{Serialize, Serializer};
|
||||
//pub use ser::{Visitor, VisitorState};
|
||||
//pub use ser::GatherTokens;
|
||||
|
Loading…
x
Reference in New Issue
Block a user