Fix clippy errors

This commit is contained in:
2025-02-24 15:02:44 +00:00
parent 03290e52a3
commit 8d57540566
15 changed files with 121 additions and 58 deletions
+4 -4
View File
@@ -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
}
}