Skip to content

Commit

Permalink
Fix clippy::semicolon_if_nothing_returned lints (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Sep 3, 2024
1 parent ed102fa commit 88d0f19
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 28 deletions.
8 changes: 4 additions & 4 deletions src/box2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,16 @@ where
for point in points {
let p = point.borrow();
if p.x < min_x {
min_x = p.x
min_x = p.x;
}
if p.x > max_x {
max_x = p.x
max_x = p.x;
}
if p.y < min_y {
min_y = p.y
min_y = p.y;
}
if p.y > max_y {
max_y = p.y
max_y = p.y;
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/box3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,22 +342,22 @@ where
for point in points {
let p = point.borrow();
if p.x < min_x {
min_x = p.x
min_x = p.x;
}
if p.x > max_x {
max_x = p.x
max_x = p.x;
}
if p.y < min_y {
min_y = p.y
min_y = p.y;
}
if p.y > max_y {
max_y = p.y
max_y = p.y;
}
if p.z < min_z {
min_z = p.z
min_z = p.z;
}
if p.z > max_z {
max_z = p.z
max_z = p.z;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl<T: Mul, U> Mul<T> for Length<T, U> {
impl<T: Copy + Mul<T, Output = T>, U> MulAssign<T> for Length<T, U> {
#[inline]
fn mul_assign(&mut self, scale: T) {
*self = *self * scale
*self = *self * scale;
}
}

Expand All @@ -291,7 +291,7 @@ impl<T: Div, U> Div<T> for Length<T, U> {
impl<T: Copy + Div<T, Output = T>, U> DivAssign<T> for Length<T, U> {
#[inline]
fn div_assign(&mut self, scale: T) {
*self = *self / scale
*self = *self / scale;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
//! foreign function interfaces (provided the underlying scalar type is also `repr(C)`).
//!
#![deny(unconditional_recursion)]
#![warn(clippy::semicolon_if_nothing_returned)]

pub use crate::angle::Angle;
pub use crate::box2d::Box2D;
Expand Down
12 changes: 6 additions & 6 deletions src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ impl<T: Add, U> Add<Vector2D<T, U>> for Point2D<T, U> {
impl<T: Copy + Add<T, Output = T>, U> AddAssign<Vector2D<T, U>> for Point2D<T, U> {
#[inline]
fn add_assign(&mut self, other: Vector2D<T, U>) {
*self = *self + other
*self = *self + other;
}
}

Expand Down Expand Up @@ -632,7 +632,7 @@ impl<T: Sub, U> Sub<Vector2D<T, U>> for Point2D<T, U> {
impl<T: Copy + Sub<T, Output = T>, U> SubAssign<Vector2D<T, U>> for Point2D<T, U> {
#[inline]
fn sub_assign(&mut self, other: Vector2D<T, U>) {
*self = *self - other
*self = *self - other;
}
}

Expand All @@ -648,7 +648,7 @@ impl<T: Copy + Mul, U> Mul<T> for Point2D<T, U> {
impl<T: Copy + Mul<T, Output = T>, U> MulAssign<T> for Point2D<T, U> {
#[inline]
fn mul_assign(&mut self, scale: T) {
*self = *self * scale
*self = *self * scale;
}
}

Expand Down Expand Up @@ -681,7 +681,7 @@ impl<T: Copy + Div, U> Div<T> for Point2D<T, U> {
impl<T: Copy + Div<T, Output = T>, U> DivAssign<T> for Point2D<T, U> {
#[inline]
fn div_assign(&mut self, scale: T) {
*self = *self / scale
*self = *self / scale;
}
}

Expand Down Expand Up @@ -1424,7 +1424,7 @@ impl<T: Add, U> Add<Vector3D<T, U>> for Point3D<T, U> {
impl<T: Copy + Add<T, Output = T>, U> AddAssign<Vector3D<T, U>> for Point3D<T, U> {
#[inline]
fn add_assign(&mut self, other: Vector3D<T, U>) {
*self = *self + other
*self = *self + other;
}
}

Expand Down Expand Up @@ -1471,7 +1471,7 @@ impl<T: Sub, U> Sub<Vector3D<T, U>> for Point3D<T, U> {
impl<T: Copy + Sub<T, Output = T>, U> SubAssign<Vector3D<T, U>> for Point3D<T, U> {
#[inline]
fn sub_assign(&mut self, other: Vector3D<T, U>) {
*self = *self - other
*self = *self - other;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ mod tests {
}
y += 0.1;
}
x += 0.1
x += 0.1;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/scale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ impl<T: Default, Src, Dst> Default for Scale<T, Src, Dst> {

impl<T: Hash, Src, Dst> Hash for Scale<T, Src, Dst> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.0.hash(state)
self.0.hash(state);
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ impl<'a, T: 'a + Add<Output = T> + Copy + Zero, U: 'a> Sum<&'a Self> for Vector2
impl<T: Copy + Add<T, Output = T>, U> AddAssign for Vector2D<T, U> {
#[inline]
fn add_assign(&mut self, other: Self) {
*self = *self + other
*self = *self + other;
}
}

Expand All @@ -804,7 +804,7 @@ impl<T: Sub, U> Sub for Vector2D<T, U> {
impl<T: Copy + Sub<T, Output = T>, U> SubAssign<Vector2D<T, U>> for Vector2D<T, U> {
#[inline]
fn sub_assign(&mut self, other: Self) {
*self = *self - other
*self = *self - other;
}
}

Expand All @@ -820,7 +820,7 @@ impl<T: Copy + Mul, U> Mul<T> for Vector2D<T, U> {
impl<T: Copy + Mul<T, Output = T>, U> MulAssign<T> for Vector2D<T, U> {
#[inline]
fn mul_assign(&mut self, scale: T) {
*self = *self * scale
*self = *self * scale;
}
}

Expand Down Expand Up @@ -853,7 +853,7 @@ impl<T: Copy + Div, U> Div<T> for Vector2D<T, U> {
impl<T: Copy + Div<T, Output = T>, U> DivAssign<T> for Vector2D<T, U> {
#[inline]
fn div_assign(&mut self, scale: T) {
*self = *self / scale
*self = *self / scale;
}
}

Expand Down Expand Up @@ -1713,7 +1713,7 @@ impl<'a, T: 'a + Add<Output = T> + Copy + Zero, U: 'a> Sum<&'a Self> for Vector3
impl<T: Copy + Add<T, Output = T>, U> AddAssign for Vector3D<T, U> {
#[inline]
fn add_assign(&mut self, other: Self) {
*self = *self + other
*self = *self + other;
}
}

Expand All @@ -1729,7 +1729,7 @@ impl<T: Sub, U> Sub for Vector3D<T, U> {
impl<T: Copy + Sub<T, Output = T>, U> SubAssign<Vector3D<T, U>> for Vector3D<T, U> {
#[inline]
fn sub_assign(&mut self, other: Self) {
*self = *self - other
*self = *self - other;
}
}

Expand All @@ -1745,7 +1745,7 @@ impl<T: Copy + Mul, U> Mul<T> for Vector3D<T, U> {
impl<T: Copy + Mul<T, Output = T>, U> MulAssign<T> for Vector3D<T, U> {
#[inline]
fn mul_assign(&mut self, scale: T) {
*self = *self * scale
*self = *self * scale;
}
}

Expand Down Expand Up @@ -1779,7 +1779,7 @@ impl<T: Copy + Div, U> Div<T> for Vector3D<T, U> {
impl<T: Copy + Div<T, Output = T>, U> DivAssign<T> for Vector3D<T, U> {
#[inline]
fn div_assign(&mut self, scale: T) {
*self = *self / scale
*self = *self / scale;
}
}

Expand Down

0 comments on commit 88d0f19

Please sign in to comment.