mirror of
https://github.com/servo/servo.git
synced 2025-07-16 20:03:39 +01:00
Auto merge of #11736 - Ms2ger:detransmute, r=jdm
Use Ref/RefMut::map rather than transmute for ServoLayoutNode. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11736) <!-- Reviewable:end -->
This commit is contained in:
commit
e32b2c9ddf
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue