Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ref/RefMut::map rather than transmute for ServoLayoutNode. #11736

Merged
merged 1 commit into from Jun 13, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Use Ref/RefMut::map rather than transmute for ServoLayoutNode.

  • Loading branch information
Ms2ger committed Jun 13, 2016
commit 172aa226cc2f956c0ca45abc3cd7c03681141316
@@ -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 {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.