зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #18061 - style: Remove a few unneeded transmutes (from emilio:trans); r=nox
Source-Repo: https://github.com/servo/servo Source-Revision: bec0d02ad3fe399d96c639b86ff46eba0af88793 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : ddca4433c0bb6fa1cbf58bab7fce851432755540
This commit is contained in:
Родитель
6e753a8ef2
Коммит
15d359a8ac
|
@ -5,7 +5,6 @@
|
|||
///! [CSS cascade origins](https://drafts.csswg.org/css-cascade/#cascading-origins).
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use std::mem::transmute;
|
||||
|
||||
/// Each style rule has an origin, which determines where it enters the cascade.
|
||||
///
|
||||
|
@ -135,9 +134,9 @@ impl<'a, T> Iterator for PerOriginIterMut<'a, T> where T: 'a {
|
|||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let result = match self.cur {
|
||||
0 => (unsafe { transmute(&mut (*self.data).author) }, Origin::Author),
|
||||
1 => (unsafe { transmute(&mut (*self.data).user) }, Origin::User),
|
||||
2 => (unsafe { transmute(&mut (*self.data).user_agent) }, Origin::UserAgent),
|
||||
0 => (unsafe { &mut (*self.data).author }, Origin::Author),
|
||||
1 => (unsafe { &mut (*self.data).user }, Origin::User),
|
||||
2 => (unsafe { &mut (*self.data).user_agent }, Origin::UserAgent),
|
||||
_ => return None,
|
||||
};
|
||||
self.cur += 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче