Fix clippy errors
This commit is contained in:
@@ -20,7 +20,7 @@ impl Coordinate for i128 {}
|
||||
impl Coordinate for f32 {}
|
||||
impl Coordinate for f64 {}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, PartialOrd, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Debug)]
|
||||
pub struct Vec2<T: Coordinate> {
|
||||
x: T,
|
||||
y: T,
|
||||
@@ -32,14 +32,14 @@ impl<T: Coordinate> Vec2<T> {
|
||||
}
|
||||
|
||||
pub fn into<S: Coordinate + From<T>>(&self) -> Vec2<S> {
|
||||
Vec2::new(self.x.clone().into(), self.y.clone().into())
|
||||
Vec2::new(self.x.into(), self.y.into())
|
||||
}
|
||||
|
||||
pub fn x(&self) -> T {
|
||||
pub const fn x(&self) -> T {
|
||||
self.x
|
||||
}
|
||||
|
||||
pub fn y(&self) -> T {
|
||||
pub const fn y(&self) -> T {
|
||||
self.y
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user