auto merge of #4389 : Ms2ger/servo/transmute, r=jdm

This commit is contained in:
bors-servo 2014-12-16 08:54:51 -07:00
commit 508924771e

View file

@ -657,15 +657,7 @@ pub struct DescendantIter<'a> {
impl<'a> Iterator<&'a mut Flow + 'a> for DescendantIter<'a> { impl<'a> Iterator<&'a mut Flow + 'a> for DescendantIter<'a> {
fn next(&mut self) -> Option<&'a mut Flow + 'a> { fn next(&mut self) -> Option<&'a mut Flow + 'a> {
match self.iter.next() { self.iter.next().map(|flow| &mut **flow)
None => None,
Some(ref mut flow) => {
unsafe {
let result: &'a mut Flow = mem::transmute(flow.deref_mut());
Some(result)
}
}
}
} }
} }