mirror of
https://github.com/servo/servo.git
synced 2025-06-22 08:08:59 +01:00
auto merge of #4389 : Ms2ger/servo/transmute, r=jdm
This commit is contained in:
commit
508924771e
1 changed files with 1 additions and 9 deletions
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue