Skip to content

Commit 06538f9

Browse files
committed
fix clippy warnings
1 parent cf4a23a commit 06538f9

File tree

5 files changed

+31
-25
lines changed

5 files changed

+31
-25
lines changed

graphene/src/matrix.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl ops::Mul<Matrix> for Matrix {
234234
type Output = Matrix;
235235

236236
fn mul(self, rhs: Matrix) -> Self::Output {
237-
(&self).multiply(&rhs)
237+
Matrix::multiply(&self, &rhs)
238238
}
239239
}
240240
impl ops::MulAssign<Matrix> for Matrix {
@@ -246,32 +246,38 @@ impl ops::MulAssign<Matrix> for Matrix {
246246
impl ops::Mul<Vec4> for Matrix {
247247
type Output = Vec4;
248248

249+
/// Transforms this `Vec4` using the provided matrix.
250+
/// See [Matrix::transform_vec4].
249251
fn mul(self, rhs: Vec4) -> Self::Output {
250-
(&self).transform_vec4(&rhs)
252+
Matrix::transform_vec4(&self, &rhs)
251253
}
252254
}
253255

254256
impl ops::Mul<Vec3> for Matrix {
255257
type Output = Vec3;
256258

259+
/// Transforms this `Vec3` using the provided matrix.
260+
/// See [Matrix::transform_vec3].
257261
fn mul(self, rhs: Vec3) -> Self::Output {
258-
(&self).transform_vec3(&rhs)
262+
Matrix::transform_vec3(&self, &rhs)
259263
}
260264
}
261265

262266
impl ops::Mul<Point> for Matrix {
263267
type Output = Point;
264268

265269
fn mul(self, rhs: Point) -> Self::Output {
266-
(&self).transform_point(&rhs)
270+
Matrix::transform_point(&self, &rhs)
267271
}
268272
}
269273

270274
impl ops::Mul<Point3D> for Matrix {
271275
type Output = Point3D;
272276

277+
/// Transforms this point using the provided matrix.
278+
/// See [Matrix::transform_point3d].
273279
fn mul(self, rhs: Point3D) -> Self::Output {
274-
(&self).transform_point3d(&rhs)
280+
Matrix::transform_point3d(&self, &rhs)
275281
}
276282
}
277283

graphene/src/quaternion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl ops::Add<Quaternion> for Quaternion {
150150
type Output = Quaternion;
151151

152152
fn add(self, rhs: Quaternion) -> Self::Output {
153-
(&self).add(&rhs)
153+
Quaternion::add(&self, &rhs)
154154
}
155155
}
156156

@@ -164,7 +164,7 @@ impl ops::Mul<Quaternion> for Quaternion {
164164
type Output = Quaternion;
165165

166166
fn mul(self, rhs: Quaternion) -> Self::Output {
167-
(&self).multiply(&rhs)
167+
Quaternion::multiply(&self, &rhs)
168168
}
169169
}
170170

graphene/src/vec2.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl ops::Add<Vec2> for Vec2 {
5858
type Output = Vec2;
5959

6060
fn add(self, rhs: Vec2) -> Self::Output {
61-
(&self).add(&rhs)
61+
Vec2::add(&self, &rhs)
6262
}
6363
}
6464
impl ops::AddAssign<Vec2> for Vec2 {
@@ -70,7 +70,7 @@ impl ops::Sub<Vec2> for Vec2 {
7070
type Output = Vec2;
7171

7272
fn sub(self, rhs: Vec2) -> Self::Output {
73-
(&self).subtract(&rhs)
73+
Vec2::subtract(&self, &rhs)
7474
}
7575
}
7676
impl ops::SubAssign<Vec2> for Vec2 {
@@ -82,7 +82,7 @@ impl ops::Neg for Vec2 {
8282
type Output = Vec2;
8383

8484
fn neg(self) -> Self::Output {
85-
(&self).negate()
85+
Vec2::negate(&self)
8686
}
8787
}
8888

@@ -91,7 +91,7 @@ impl ops::Mul<f32> for Vec2 {
9191
type Output = Vec2;
9292

9393
fn mul(self, rhs: f32) -> Self::Output {
94-
(&self).scale(rhs)
94+
Vec2::scale(&self, rhs)
9595
}
9696
}
9797
impl ops::MulAssign<f32> for Vec2 {
@@ -112,7 +112,7 @@ impl ops::Mul<Vec2> for Vec2 {
112112
type Output = Vec2;
113113

114114
fn mul(self, rhs: Vec2) -> Self::Output {
115-
(&self).multiply(&rhs)
115+
Vec2::multiply(&self, &rhs)
116116
}
117117
}
118118
impl ops::MulAssign<Vec2> for Vec2 {
@@ -124,7 +124,7 @@ impl ops::Div<Vec2> for Vec2 {
124124
type Output = Vec2;
125125

126126
fn div(self, rhs: Vec2) -> Self::Output {
127-
(&self).divide(&rhs)
127+
Vec2::divide(&self, &rhs)
128128
}
129129
}
130130
impl ops::DivAssign<Vec2> for Vec2 {

graphene/src/vec3.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl ops::Add<Vec3> for Vec3 {
5959
type Output = Vec3;
6060

6161
fn add(self, rhs: Vec3) -> Self::Output {
62-
(&self).add(&rhs)
62+
Vec3::add(&self, &rhs)
6363
}
6464
}
6565
impl ops::AddAssign<Vec3> for Vec3 {
@@ -71,7 +71,7 @@ impl ops::Sub<Vec3> for Vec3 {
7171
type Output = Vec3;
7272

7373
fn sub(self, rhs: Vec3) -> Self::Output {
74-
(&self).subtract(&rhs)
74+
Vec3::subtract(&self, &rhs)
7575
}
7676
}
7777
impl ops::SubAssign<Vec3> for Vec3 {
@@ -83,7 +83,7 @@ impl ops::Neg for Vec3 {
8383
type Output = Vec3;
8484

8585
fn neg(self) -> Self::Output {
86-
(&self).negate()
86+
Vec3::negate(&self)
8787
}
8888
}
8989

@@ -92,7 +92,7 @@ impl ops::Mul<f32> for Vec3 {
9292
type Output = Vec3;
9393

9494
fn mul(self, rhs: f32) -> Self::Output {
95-
(&self).scale(rhs)
95+
Vec3::scale(&self, rhs)
9696
}
9797
}
9898
impl ops::MulAssign<f32> for Vec3 {
@@ -113,7 +113,7 @@ impl ops::Mul<Vec3> for Vec3 {
113113
type Output = Vec3;
114114

115115
fn mul(self, rhs: Vec3) -> Self::Output {
116-
(&self).multiply(&rhs)
116+
Vec3::multiply(&self, &rhs)
117117
}
118118
}
119119
impl ops::MulAssign<Vec3> for Vec3 {
@@ -125,7 +125,7 @@ impl ops::Div<Vec3> for Vec3 {
125125
type Output = Vec3;
126126

127127
fn div(self, rhs: Vec3) -> Self::Output {
128-
(&self).divide(&rhs)
128+
Vec3::divide(&self, &rhs)
129129
}
130130
}
131131
impl ops::DivAssign<Vec3> for Vec3 {

graphene/src/vec4.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl ops::Add<Vec4> for Vec4 {
8282
type Output = Vec4;
8383

8484
fn add(self, rhs: Vec4) -> Self::Output {
85-
(&self).add(&rhs)
85+
Vec4::add(&self, &rhs)
8686
}
8787
}
8888
impl ops::AddAssign<Vec4> for Vec4 {
@@ -94,7 +94,7 @@ impl ops::Sub<Vec4> for Vec4 {
9494
type Output = Vec4;
9595

9696
fn sub(self, rhs: Vec4) -> Self::Output {
97-
(&self).subtract(&rhs)
97+
Vec4::subtract(&self, &rhs)
9898
}
9999
}
100100
impl ops::SubAssign<Vec4> for Vec4 {
@@ -106,7 +106,7 @@ impl ops::Neg for Vec4 {
106106
type Output = Vec4;
107107

108108
fn neg(self) -> Self::Output {
109-
(&self).negate()
109+
Vec4::negate(&self)
110110
}
111111
}
112112

@@ -115,7 +115,7 @@ impl ops::Mul<f32> for Vec4 {
115115
type Output = Vec4;
116116

117117
fn mul(self, rhs: f32) -> Self::Output {
118-
(&self).scale(rhs)
118+
Vec4::scale(&self, rhs)
119119
}
120120
}
121121
impl ops::MulAssign<f32> for Vec4 {
@@ -136,7 +136,7 @@ impl ops::Mul<Vec4> for Vec4 {
136136
type Output = Vec4;
137137

138138
fn mul(self, rhs: Vec4) -> Self::Output {
139-
(&self).multiply(&rhs)
139+
Vec4::multiply(&self, &rhs)
140140
}
141141
}
142142
impl ops::MulAssign<Vec4> for Vec4 {
@@ -148,7 +148,7 @@ impl ops::Div<Vec4> for Vec4 {
148148
type Output = Vec4;
149149

150150
fn div(self, rhs: Vec4) -> Self::Output {
151-
(&self).divide(&rhs)
151+
Vec4::divide(&self, &rhs)
152152
}
153153
}
154154
impl ops::DivAssign<Vec4> for Vec4 {

0 commit comments

Comments
 (0)