зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #11736 - Use Ref/RefMut::map rather than transmute for ServoLayoutNode (from Ms2ger:detransmute); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: e32b2c9ddf7f6c44057812d7840e2e93ce5eb7bd
This commit is contained in:
Родитель
8a6bb3f4ed
Коммит
6ff26ad9ec
|
@ -233,11 +233,11 @@ impl<'ln> TNode for ServoLayoutNode<'ln> {
|
|||
}
|
||||
|
||||
fn borrow_data(&self) -> Option<Ref<PrivateStyleData>> {
|
||||
unsafe { self.borrow_layout_data().map(|d| transmute(d)) }
|
||||
self.borrow_layout_data().map(|d| Ref::map(d, |d| &d.style_data))
|
||||
}
|
||||
|
||||
fn mutate_data(&self) -> Option<RefMut<PrivateStyleData>> {
|
||||
unsafe { self.mutate_layout_data().map(|d| transmute(d)) }
|
||||
self.mutate_layout_data().map(|d| RefMut::map(d, |d| &mut d.style_data))
|
||||
}
|
||||
|
||||
fn restyle_damage(self) -> RestyleDamage {
|
||||
|
|
Загрузка…
Ссылка в новой задаче