mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Add ToShmem impl for Atom.
Differential Revision: https://phabricator.services.mozilla.com/D17192
This commit is contained in:
parent
48718b876c
commit
8c007ad999
1 changed files with 11 additions and 1 deletions
|
@ -25,9 +25,11 @@ use std::char::{self, DecodeUtf16};
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::iter::Cloned;
|
use std::iter::Cloned;
|
||||||
|
use std::mem::{self, ManuallyDrop};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::{mem, slice, str};
|
use std::{slice, str};
|
||||||
use style_traits::SpecifiedValueInfo;
|
use style_traits::SpecifiedValueInfo;
|
||||||
|
use to_shmem::{SharedMemoryBuilder, ToShmem};
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
#[allow(improper_ctypes, non_camel_case_types, missing_docs)]
|
#[allow(improper_ctypes, non_camel_case_types, missing_docs)]
|
||||||
|
@ -122,6 +124,14 @@ impl Borrow<WeakAtom> for Atom {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ToShmem for Atom {
|
||||||
|
fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> ManuallyDrop<Self> {
|
||||||
|
assert!(self.is_static(), "ToShmem failed for Atom: must be a static atom: {}", self);
|
||||||
|
|
||||||
|
ManuallyDrop::new(Atom(self.0))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Eq for WeakAtom {}
|
impl Eq for WeakAtom {}
|
||||||
impl PartialEq for WeakAtom {
|
impl PartialEq for WeakAtom {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue