Skip to content

Commit

Permalink
Fix - clean workspace and crates (#2)
Browse files Browse the repository at this point in the history
* fix: workspace && crate instead of basic folder

* Restyled by rustfmt

* Restyled by whitespace

* Restyled by rustfmt (#4)

Co-authored-by: Restyled.io <commits@restyled.io>

---------

Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 1, 2023
1 parent 8196f9e commit 7b5ca17
Show file tree
Hide file tree
Showing 33 changed files with 81 additions and 22 deletions.
21 changes: 15 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
[package]
name = "frakt"
authors = ["James <jabib@myges.fr>", "Ronan <rkielt@myges.fr>", "Charles <ccretois@myges.fr>"]
authors = ["James <jabib@myges.fr>", "Ronan <rkielt@myges.fr>", "Charles <ccretois@myges.fr>", "Samira <sseddar@myges.fr>"]
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "client"
path = "client/src/main.rs"

[dependencies]
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
image = "0.24.7"
[[bin]]
name = "server"
path = "server/src/main.rs"

[workspace]
members = [
"client",
"shared",
"server",
"complex",
]
12 changes: 12 additions & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "client"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]


[dependencies.shared]
path = "../shared"
1 change: 1 addition & 0 deletions client/src/calculations.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions client/src/client.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions client/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("[CLIENT] Hello, world!");
}
File renamed without changes.
12 changes: 12 additions & 0 deletions complex/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "complex"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]


[dependencies.shared]
path = "../shared"
1 change: 1 addition & 0 deletions complex/src/complex_impl.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions complex/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod complex_impl;
12 changes: 12 additions & 0 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "server"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]


[dependencies.shared]
path = "../shared"
1 change: 1 addition & 0 deletions server/src/handler.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions server/src/image.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions server/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("[SERVER] Hello, world!");
}
File renamed without changes.
8 changes: 8 additions & 0 deletions shared/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "shared"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
1 change: 1 addition & 0 deletions src/common/mod.rs → shared/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod types;
pub mod utils;
2 changes: 1 addition & 1 deletion src/types/complex.rs → shared/src/types/complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pub struct Complex {
pub re: f64,
pub im: f64,
}
}
1 change: 0 additions & 1 deletion src/types/messages.rs → shared/src/types/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ pub struct FragmentResult {
pub pixel_data: PixelData,
pub pixel_intensity: Vec<PixelIntensity>,
}

2 changes: 1 addition & 1 deletion src/types/mod.rs → shared/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod complex;
pub mod messages;
pub mod pixel_intensity;
pub mod pixel_data;
pub mod pixel_intensity;
pub mod point;
pub mod range;
pub mod resolution;
Expand Down
2 changes: 1 addition & 1 deletion src/types/pixel_data.rs → shared/src/types/pixel_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pub struct PixelData {
pub offset: u32,
pub count: u32,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pub struct PixelIntensity {
pub zn: f32,
pub count: f32,
}
}
2 changes: 1 addition & 1 deletion src/types/point.rs → shared/src/types/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pub struct Point {
pub x: f64,
pub y: f64,
}
}
2 changes: 1 addition & 1 deletion src/types/range.rs → shared/src/types/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ use crate::types::point::Point;
pub struct Range {
pub min: Point,
pub max: Point,
}
}
2 changes: 1 addition & 1 deletion src/types/resolution.rs → shared/src/types/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pub struct Resolution {
pub nx: u16,
pub ny: u16,
}
}
2 changes: 1 addition & 1 deletion src/types/u8data.rs → shared/src/types/u8data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pub struct U8Data {
pub offset: u32,
pub count: u32,
}
}
1 change: 1 addition & 0 deletions shared/src/utils.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file removed src/common/utils.rs
Empty file.
4 changes: 0 additions & 4 deletions src/lib.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/main.rs

This file was deleted.

Empty file removed src/server/handler.rs
Empty file.
Empty file removed src/server/image.rs
Empty file.
Empty file removed src/worker/calculations.rs
Empty file.
Empty file removed src/worker/client.rs
Empty file.

0 comments on commit 7b5ca17

Please sign in to comment.