diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 8cfe0c98169..6a2287dc033 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -701,18 +701,11 @@ pub mod basic_shape { /// Generate a SVGPathData from StyleShapeSource if possible. fn to_svg_path(&self) -> Option { - use gecko_bindings::structs::StylePathCommand; use values::specified::svg_path::PathCommand; match self.mType { StyleShapeSourceType::Path => { let gecko_path = unsafe { &*self.__bindgen_anon_1.mSVGPath.as_ref().mPtr }; - let result: Vec = gecko_path - .mPath - .iter() - .map(|gecko: &StylePathCommand| { - // unsafe: cbindgen ensures the representation is the same. - unsafe { ::std::mem::transmute(*gecko) } - }).collect(); + let result: Vec = gecko_path.mPath.iter().cloned().collect(); Some(SVGPathData::new(result.into_boxed_slice())) }, _ => None, diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 6f112343b0e..59beaea0a80 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -4947,11 +4947,7 @@ fn set_style_svg_path( &mut shape_source.__bindgen_anon_1.mSVGPath.as_mut().mPtr.as_mut().unwrap() }; - let iter = servo_path.commands().iter().map(|command| { - // unsafe: cbindgen ensures the representation is the same. - unsafe { transmute(*command) } - }); - gecko_path.mPath.assign_from_iter_pod(iter); + gecko_path.mPath.assign_from_iter_pod(servo_path.commands().iter().cloned()); // Setup fill-rule. gecko_path.mFillRule = fill;