Clear clippy warnings

This commit is contained in:
Elnu 2023-05-30 12:34:43 -07:00
parent c72bd94291
commit 683917dd74
5 changed files with 19 additions and 17 deletions

View file

@ -163,10 +163,10 @@ impl App {
}
let Vector2f { x, y } = shape.position();
if x >= WIDTH - SIZE || x < 0.0 {
if !(0.0..WIDTH - SIZE).contains(&x) {
velocity.x *= -1.0;
}
if y >= HEIGHT - SIZE || y < 0.0 {
if !(0.0..HEIGHT - SIZE).contains(&y) {
velocity.y *= -1.0;
}
shape.set_position(Vector2f::new(x + velocity.x, y + velocity.y));