From 172aa226cc2f956c0ca45abc3cd7c03681141316 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 13 Jun 2016 12:29:14 +0100 Subject: [PATCH] Use Ref/RefMut::map rather than transmute for ServoLayoutNode. --- components/layout/wrapper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index b6c5266c2cb..303c9f76943 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -233,11 +233,11 @@ impl<'ln> TNode for ServoLayoutNode<'ln> { } fn borrow_data(&self) -> Option> { - 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> { - 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 {