Skip to content

Commit b1855d7

Browse files
Update dependencies versions in Cargo.lock and Cargo.toml
1 parent 8fd3d96 commit b1855d7

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

Cargo.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
clap = { version = "4.4.13", features = ["derive"] }
9+
clap = { version = "4.4.14", features = ["derive"] }
1010

1111

1212
[profile.release]

build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
fn main() {
22
// Linux
3-
println!("cargo:rustc-link-search=native=pkg/raylib/usr/lib");
3+
// println!("cargo:rustc-link-search=native=pkg/raylib/usr/lib");
44

55
// Windows
6-
//println!("cargo:rustc-link-search=native=raylib/lib");
6+
println!("cargo:rustc-link-search=native=raylib/lib");
77
println!("cargo:rustc-link-lib=static=raylib");
88
}

src/main.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![windows_subsystem = "windows"]
1+
// #![windows_subsystem = "windows"]
22
mod particle;
33
mod raylib;
44

@@ -7,7 +7,7 @@ use std::ffi::CString;
77

88
#[derive(Parser)]
99
#[clap(
10-
version = "1.3.2",
10+
version,
1111
author = "Lucas Linhares",
1212
about = r#"Raylib Particle Attraction/Repulsion
1313
Keybindings:
@@ -101,13 +101,11 @@ fn main() {
101101

102102
let mut ball_size = if let Some(ball_size) = args.ball_size {
103103
ball_size
104-
} else {
105-
if args.balls {
104+
} else if args.balls {
106105
20.0
107106
} else {
108107
1.0
109-
}
110-
};
108+
};
111109

112110
if args.no_labels {
113111
args.no_fps = true;

src/particle.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct Particle {
1010
impl Particle {
1111
pub fn new(width: i32, height: i32) -> Self {
1212
unsafe {
13-
let particle = Self {
13+
Self {
1414
position: raylib::Vector2 {
1515
x: raylib::GetRandomValue(0, width - 1) as f32,
1616
y: raylib::GetRandomValue(0, height - 1) as f32,
@@ -25,16 +25,15 @@ impl Particle {
2525
b: 0,
2626
a: 100,
2727
},
28-
};
28+
}
2929

30-
particle
3130
}
3231
}
3332

3433
pub fn get_distance_to(&self, other: Vector2) -> f32 {
3534
let x = self.position.x - other.x;
3635
let y = self.position.y - other.y;
37-
let distance = ((x * x) + (y * y)) as f32;
36+
let distance = (x * x) + (y * y);
3837
distance.sqrt()
3938
}
4039

0 commit comments

Comments
 (0)