cargo fmt for pyglet_rs

This commit is contained in:
shenjack 2023-03-28 17:28:49 +08:00
parent 6e07d9edfa
commit 9fd5c523ee
3 changed files with 29 additions and 10 deletions

View File

@ -7,8 +7,8 @@
*/ */
mod math; mod math;
mod sprite;
mod pymath; mod pymath;
mod sprite;
use pyo3::prelude::*; use pyo3::prelude::*;

View File

@ -45,7 +45,7 @@ pub mod vector {
type Output = Self; type Output = Self;
fn add(self, rhs: Self) -> Self::Output { fn add(self, rhs: Self) -> Self::Output {
Self::new(self.x + other.x, self.y + other.y) Self::new(self.x + rhs.x, self.y + rhs.y)
} }
} }
@ -53,7 +53,7 @@ pub mod vector {
type Output = Self; type Output = Self;
fn sub(self, rhs: Self) -> Self::Output { fn sub(self, rhs: Self) -> Self::Output {
Self::new(self.x - other.x, self.y - other.y) Self::new(self.x - rhs.x, self.y - rhs.y)
} }
} }
@ -61,7 +61,7 @@ pub mod vector {
type Output = Self; type Output = Self;
fn mul(self, rhs: Self) -> Self::Output { fn mul(self, rhs: Self) -> Self::Output {
Self::new(self.x * other.x, self.y * other.y) Self::new(self.x * rhs.x, self.y * rhs.y)
} }
} }
@ -69,7 +69,7 @@ pub mod vector {
type Output = Self; type Output = Self;
fn div(self, rhs: Self) -> Self::Output { fn div(self, rhs: Self) -> Self::Output {
Self::new(self.x / other.x, self.y / other.y) Self::new(self.x / rhs.x, self.y / rhs.y)
} }
} }
@ -238,7 +238,12 @@ pub mod vector {
type Output = Self; type Output = Self;
fn add(self, rhs: Self) -> Self::Output { fn add(self, rhs: Self) -> Self::Output {
Self::new(self.x + rhs.x, self.y + rhs.y, self.z + rhs.z, self.w + rhs.w) Self::new(
self.x + rhs.x,
self.y + rhs.y,
self.z + rhs.z,
self.w + rhs.w,
)
} }
} }
@ -246,7 +251,12 @@ pub mod vector {
type Output = Self; type Output = Self;
fn sub(self, rhs: Self) -> Self::Output { fn sub(self, rhs: Self) -> Self::Output {
Self::new(self.x - rhs.x, self.y - rhs.y, self.z - rhs.z, self.w - rhs.w) Self::new(
self.x - rhs.x,
self.y - rhs.y,
self.z - rhs.z,
self.w - rhs.w,
)
} }
} }
@ -254,7 +264,12 @@ pub mod vector {
type Output = Self; type Output = Self;
fn mul(self, rhs: Self) -> Self::Output { fn mul(self, rhs: Self) -> Self::Output {
Self::new(self.x * rhs.x, self.y * rhs.y, self.z * rhs.z, self.w * rhs.w) Self::new(
self.x * rhs.x,
self.y * rhs.y,
self.z * rhs.z,
self.w * rhs.w,
)
} }
} }
@ -262,7 +277,12 @@ pub mod vector {
type Output = Self; type Output = Self;
fn div(self, rhs: Self) -> Self::Output { fn div(self, rhs: Self) -> Self::Output {
Self::new(self.x / rhs.x, self.y / rhs.y, self.z / rhs.z, self.w / rhs.w) Self::new(
self.x / rhs.x,
self.y / rhs.y,
self.z / rhs.z,
self.w / rhs.w,
)
} }
} }

View File

@ -6,7 +6,6 @@
* ------------------------------- * -------------------------------
*/ */
pub mod python_class { pub mod python_class {
use pyo3::prelude::*; use pyo3::prelude::*;