style: Fix servo build, and appease tidy / fmt.

This commit is contained in:
Emilio Cobos Álvarez 2019-04-11 22:16:56 +02:00
parent 8c004c0858
commit 49842f5031
23 changed files with 165 additions and 53 deletions

View file

@ -20,10 +20,12 @@ pub use crate::origin::{ImmutableOrigin, MutableOrigin, OpaqueOrigin};
use std::collections::hash_map::DefaultHasher;
use std::fmt;
use std::hash::Hasher;
use std::mem::ManuallyDrop;
use std::net::IpAddr;
use std::ops::{Index, Range, RangeFrom, RangeFull, RangeTo};
use std::path::Path;
use std::sync::Arc;
use to_shmem::{SharedMemoryBuilder, ToShmem};
use url::{Position, Url};
pub use url::Host;
@ -31,6 +33,12 @@ pub use url::Host;
#[derive(Clone, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd)]
pub struct ServoUrl(#[ignore_malloc_size_of = "Arc"] Arc<Url>);
impl ToShmem for ServoUrl {
fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> ManuallyDrop<Self> {
unimplemented!("If servo wants to share stylesheets across processes, ToShmem for Url must be implemented")
}
}
impl ServoUrl {
pub fn from_url(url: Url) -> Self {
ServoUrl(Arc::new(url))