mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use Untraceable<T> to hold LayoutDataRef instead of manual Encodable implementation.
This commit is contained in:
parent
54d3a0b280
commit
de0866ab42
3 changed files with 9 additions and 9 deletions
|
@ -77,20 +77,20 @@ pub trait LayoutDataAccess {
|
|||
impl<'ln> LayoutDataAccess for LayoutNode<'ln> {
|
||||
#[inline(always)]
|
||||
unsafe fn borrow_layout_data_unchecked(&self) -> *const Option<LayoutDataWrapper> {
|
||||
mem::transmute(self.get().layout_data.borrow_unchecked())
|
||||
mem::transmute(self.get().layout_data.deref().borrow_unchecked())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn borrow_layout_data<'a>(&'a self) -> Ref<'a,Option<LayoutDataWrapper>> {
|
||||
unsafe {
|
||||
mem::transmute(self.get().layout_data.borrow())
|
||||
mem::transmute(self.get().layout_data.deref().borrow())
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn mutate_layout_data<'a>(&'a self) -> RefMut<'a,Option<LayoutDataWrapper>> {
|
||||
unsafe {
|
||||
mem::transmute(self.get().layout_data.borrow_mut())
|
||||
mem::transmute(self.get().layout_data.deref().borrow_mut())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue