Update serde to 0.9 (fixes #15325)

This commit is contained in:
Anthony Ramine 2017-02-10 02:35:26 +01:00
parent 26d6c96b18
commit fe3f4ff0c2
73 changed files with 630 additions and 604 deletions

View file

@ -11,16 +11,16 @@ name = "gfx"
path = "lib.rs"
[dependencies]
app_units = "0.3"
app_units = "0.4"
bitflags = "0.7"
euclid = "0.10.1"
euclid = "0.11"
fnv = "1.0"
fontsan = {git = "https://github.com/servo/fontsan"}
gfx_traits = {path = "../gfx_traits"}
harfbuzz-sys = "0.1"
heapsize = "0.3.0"
heapsize_derive = "0.1"
ipc-channel = "0.6.3"
ipc-channel = "0.7"
lazy_static = "0.2"
libc = "0.2"
log = "0.3.5"
@ -29,8 +29,8 @@ net_traits = {path = "../net_traits"}
ordered-float = "0.4"
plugins = {path = "../plugins"}
range = {path = "../range"}
serde = "0.8"
serde_derive = "0.8"
serde = "0.9"
serde_derive = "0.9"
servo_atoms = {path = "../atoms"}
servo_geometry = {path = "../geometry"}
servo_url = {path = "../url"}
@ -49,8 +49,8 @@ features = ["serde_derive", "ipc"]
[target.'cfg(target_os = "macos")'.dependencies]
byteorder = "1.0"
core-foundation = "0.3"
core-graphics = "0.6"
core-text = "3.0"
core-graphics = "0.7"
core-text = "4.0"
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
freetype = "0.2"
@ -60,5 +60,5 @@ servo-fontconfig = "0.2.1"
simd = "0.2.0"
[target.'cfg(target_os = "windows")'.dependencies]
dwrote = "0.1.5"
dwrote = {git = "https://github.com/servo/dwrote-rs.git", rev = "servo"}
truetype = "0.26"

View file

@ -13,6 +13,7 @@ use servo_atoms::Atom;
use servo_url::ServoUrl;
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::fmt;
use std::fs::File;
use std::io::{Read, Error as IoError};
use std::ops::Deref;
@ -121,21 +122,25 @@ impl Deref for CachedCTFont {
}
impl Serialize for CachedCTFont {
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer {
serializer.serialize_none()
}
}
impl Deserialize for CachedCTFont {
fn deserialize<D>(deserializer: &mut D) -> Result<CachedCTFont, D::Error>
fn deserialize<D>(deserializer: D) -> Result<CachedCTFont, D::Error>
where D: Deserializer {
struct NoneOptionVisitor;
impl Visitor for NoneOptionVisitor {
type Value = CachedCTFont;
fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "none")
}
#[inline]
fn visit_none<E>(&mut self) -> Result<CachedCTFont, E> where E: Error {
fn visit_none<E>(self) -> Result<CachedCTFont, E> where E: Error {
Ok(CachedCTFont(Mutex::new(HashMap::new())))
}
}