diff --git a/core/src/avm2/events.rs b/core/src/avm2/events.rs index eba8102ee..31b63a4cf 100644 --- a/core/src/avm2/events.rs +++ b/core/src/avm2/events.rs @@ -22,12 +22,12 @@ pub enum EventPhase { Bubbling, } -impl Into for EventPhase { - fn into(self) -> u32 { - match self { - Self::Capturing => 1, - Self::AtTarget => 2, - Self::Bubbling => 3, +impl From for u32 { + fn from(event: EventPhase) -> u32 { + match event { + EventPhase::Capturing => 1, + EventPhase::AtTarget => 2, + EventPhase::Bubbling => 3, } } } diff --git a/core/src/html/dimensions.rs b/core/src/html/dimensions.rs index 6606d8433..2c2ce102a 100644 --- a/core/src/html/dimensions.rs +++ b/core/src/html/dimensions.rs @@ -156,16 +156,16 @@ where } } -impl Into for BoxBounds +impl From> for Rectangle where T: Into + Add, { - fn into(self) -> Rectangle { + fn from(bounds: BoxBounds) -> Rectangle { Rectangle { - x_min: self.offset_x.into(), - x_max: self.extent_x.into(), - y_min: self.offset_y.into(), - y_max: self.extent_y.into(), + x_min: bounds.offset_x.into(), + x_max: bounds.extent_x.into(), + y_min: bounds.offset_y.into(), + y_max: bounds.extent_y.into(), } } } diff --git a/core/src/types.rs b/core/src/types.rs index 4289fc2a8..23e872d18 100644 --- a/core/src/types.rs +++ b/core/src/types.rs @@ -80,8 +80,8 @@ impl From for Degrees { } } -impl Into for Degrees { - fn into(self) -> f64 { - self.0 +impl From for f64 { + fn from(degrees: Degrees) -> Self { + degrees.0 } } diff --git a/core/src/vminterface.rs b/core/src/vminterface.rs index fffca5547..06bb423b1 100644 --- a/core/src/vminterface.rs +++ b/core/src/vminterface.rs @@ -54,11 +54,11 @@ impl Instantiator { } } -impl Into> for Instantiator { - fn into(self) -> Option { - match self { - Self::Avm1 => Some(AvmType::Avm1), - Self::Avm2 => Some(AvmType::Avm2), +impl From for Option { + fn from(instantiator: Instantiator) -> Option { + match instantiator { + Instantiator::Avm1 => Some(AvmType::Avm1), + Instantiator::Avm2 => Some(AvmType::Avm2), _ => None, } }