chore: Appease clippy

This commit is contained in:
Mike Welsh 2021-01-04 12:39:59 -08:00
parent 201d014edb
commit fae1d6fd6a
4 changed files with 20 additions and 20 deletions

View File

@ -22,12 +22,12 @@ pub enum EventPhase {
Bubbling, Bubbling,
} }
impl Into<u32> for EventPhase { impl From<EventPhase> for u32 {
fn into(self) -> u32 { fn from(event: EventPhase) -> u32 {
match self { match event {
Self::Capturing => 1, EventPhase::Capturing => 1,
Self::AtTarget => 2, EventPhase::AtTarget => 2,
Self::Bubbling => 3, EventPhase::Bubbling => 3,
} }
} }
} }

View File

@ -156,16 +156,16 @@ where
} }
} }
impl<T> Into<Rectangle> for BoxBounds<T> impl<T> From<BoxBounds<T>> for Rectangle
where where
T: Into<Twips> + Add<T, Output = T>, T: Into<Twips> + Add<T, Output = T>,
{ {
fn into(self) -> Rectangle { fn from(bounds: BoxBounds<T>) -> Rectangle {
Rectangle { Rectangle {
x_min: self.offset_x.into(), x_min: bounds.offset_x.into(),
x_max: self.extent_x.into(), x_max: bounds.extent_x.into(),
y_min: self.offset_y.into(), y_min: bounds.offset_y.into(),
y_max: self.extent_y.into(), y_max: bounds.extent_y.into(),
} }
} }
} }

View File

@ -80,8 +80,8 @@ impl From<f64> for Degrees {
} }
} }
impl Into<f64> for Degrees { impl From<Degrees> for f64 {
fn into(self) -> f64 { fn from(degrees: Degrees) -> Self {
self.0 degrees.0
} }
} }

View File

@ -54,11 +54,11 @@ impl Instantiator {
} }
} }
impl Into<Option<AvmType>> for Instantiator { impl From<Instantiator> for Option<AvmType> {
fn into(self) -> Option<AvmType> { fn from(instantiator: Instantiator) -> Option<AvmType> {
match self { match instantiator {
Self::Avm1 => Some(AvmType::Avm1), Instantiator::Avm1 => Some(AvmType::Avm1),
Self::Avm2 => Some(AvmType::Avm2), Instantiator::Avm2 => Some(AvmType::Avm2),
_ => None, _ => None,
} }
} }