Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just added a .cargo directory and updated the version of the dependencies. #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
target = "x86_64-unknown-linux-musl"
rustflags = ["-C","target-cpu=native"]
17 changes: 14 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "0.3", features = ["full"] }
image = "0.23.12"
rand = "0.7.3"
tokio = { version = "1.9.0", features = ["full"] }
image = "0.23.14"
rand = "0.8.4"

[profile.release]
opt-level = 3
debug = false
debug-assertions = false
overflow-checks = false
lto = true
panic = 'unwind'
incremental = false
codegen-units = 16
rpath = false
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ fn render_line(line_number: u32, px: f64, py: f64) -> (Vec<u8>, u32) {
for x in 0..WIDTH {
let sampled_colours = (0..NB_SAMPLES)
.map(|_| {
let nx = SIZE * (((x as f64) + rng.gen_range(0., 1.0)) / (WIDTH as f64)) + px;
let nx = SIZE * (((x as f64) + rng.gen_range(0. .. 1.0)) / (WIDTH as f64)) + px;
let ny =
SIZE * (((line_number as f64) + rng.gen_range(0., 1.0)) / (HEIGHT as f64)) + py;
SIZE * (((line_number as f64) + rng.gen_range(0. .. 1.0)) / (HEIGHT as f64)) + py;
let (m_res, m_iter) = mandelbrot_iter(nx, ny);
paint(m_res, m_iter)
})
Expand Down