generated from ElnuDev/rust-project
Clear clippy warnings
This commit is contained in:
parent
c72bd94291
commit
683917dd74
5 changed files with 19 additions and 17 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue