diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-12-16 08:54:51 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-12-16 08:54:51 -0700 |
commit | 508924771e8f0f60700931ebd88aebf8c8889e44 (patch) | |
tree | 91cd5bca40037b3c2dbf773b3d8e8efb474e4134 | |
parent | cd1ccacf5e803281ead0168c3ac1ba5f64dc9343 (diff) | |
parent | eafa8b48fca834a8fe4c7fee9fe54c280f242e17 (diff) | |
download | servo-508924771e8f0f60700931ebd88aebf8c8889e44.tar.gz servo-508924771e8f0f60700931ebd88aebf8c8889e44.zip |
auto merge of #4389 : Ms2ger/servo/transmute, r=jdm
-rw-r--r-- | components/layout/flow.rs | 10 |
1 files changed, 1 insertions, 9 deletions
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) } } |