Skip to content

Commit

Permalink
fix(linting): fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskw1999 committed Jun 16, 2024
1 parent 57259db commit ca79361
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/collision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn check_collisions(collidable1: &dyn Collidable, collidable2: &dyn Collidab
};

for line in borders.windows(2) {
if is_point_on_line(&point, (&line[0], &line[1])) {
if is_point_on_line(point, (&line[0], &line[1])) {
return true;
}
}
Expand Down Expand Up @@ -70,7 +70,7 @@ pub fn check_collisions(collidable1: &dyn Collidable, collidable2: &dyn Collidab
let t = ((x1 - x3) * (y3 - y4) - (y1 - y3) * (x3 - x4)) / den;
let u = -((x1 - x2) * (y1 - y3) - (y1 - y2) * (x1 - x3)) / den;

if t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0 {
if (0.0..=1.0).contains(&t) && (0.0..=1.0).contains(&u) {
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Point {

impl Collidable for Point {
fn get_border(&self) -> Vec<Coord> {
return vec![self.coord.clone()];
vec![self.coord.clone()]
}
}

Expand Down

0 comments on commit ca79361

Please sign in to comment.