mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update serde to 0.9 (fixes #15325)
This commit is contained in:
parent
26d6c96b18
commit
fe3f4ff0c2
73 changed files with 630 additions and 604 deletions
|
@ -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())))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue