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,
}
impl Into<u32> for EventPhase {
fn into(self) -> u32 {
match self {
Self::Capturing => 1,
Self::AtTarget => 2,
Self::Bubbling => 3,
impl From<EventPhase> for u32 {
fn from(event: EventPhase) -> u32 {
match event {
EventPhase::Capturing => 1,
EventPhase::AtTarget => 2,
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
T: Into<Twips> + Add<T, Output = T>,
{
fn into(self) -> Rectangle {
fn from(bounds: BoxBounds<T>) -> 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(),
}
}
}

View File

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

View File

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