Fix lints by clippy
This commit is contained in:
parent
edce457365
commit
7e22e2d452
9 changed files with 20 additions and 28 deletions
|
|
@ -36,12 +36,9 @@ pub enum Position {
|
|||
},
|
||||
}
|
||||
|
||||
impl Into<Position> for (Point, Point) {
|
||||
fn into(self) -> Position {
|
||||
Position::Absolute {
|
||||
start: self.0,
|
||||
end: self.1,
|
||||
}
|
||||
impl From<(Point, Point)> for Position {
|
||||
fn from((start, end): (Point, Point)) -> Self {
|
||||
Self::Absolute { start, end }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,9 @@ pub enum Style {
|
|||
Gradient(Gradient),
|
||||
}
|
||||
|
||||
impl<'a> Into<Style> for Gradient {
|
||||
fn into(self) -> Style {
|
||||
match self {
|
||||
Gradient::Linear(linear) => {
|
||||
Style::Gradient(Gradient::Linear(linear))
|
||||
}
|
||||
}
|
||||
impl From<Gradient> for Style {
|
||||
fn from(gradient: Gradient) -> Self {
|
||||
Self::Gradient(gradient)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ impl From<Transformation> for [f32; 16] {
|
|||
}
|
||||
}
|
||||
|
||||
impl Into<Mat4> for Transformation {
|
||||
fn into(self) -> Mat4 {
|
||||
self.0
|
||||
impl From<Transformation> for Mat4 {
|
||||
fn from(transformation: Transformation) -> Self {
|
||||
transformation.0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ impl<'a> From<Color> for Fill<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<Fill<'a>> for &'a Gradient {
|
||||
fn into(self) -> Fill<'a> {
|
||||
impl<'a> From<&'a Gradient> for Fill<'a> {
|
||||
fn from(gradient: &'a Gradient) -> Self {
|
||||
Fill {
|
||||
style: Style::Gradient(self),
|
||||
style: Style::Gradient(gradient),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue