From eafa8b48fca834a8fe4c7fee9fe54c280f242e17 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 16 Dec 2014 15:08:22 +0100 Subject: Fix bogus transmute. --- components/layout/flow.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'components/layout/flow.rs') diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 20645e70123..c7ce0275ef6 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -657,15 +657,7 @@ pub struct DescendantIter<'a> { impl<'a> Iterator<&'a mut Flow + 'a> for DescendantIter<'a> { fn next(&mut self) -> Option<&'a mut Flow + 'a> { - match self.iter.next() { - None => None, - Some(ref mut flow) => { - unsafe { - let result: &'a mut Flow = mem::transmute(flow.deref_mut()); - Some(result) - } - } - } + self.iter.next().map(|flow| &mut **flow) } } -- cgit v1.2.3