From cdf3ed0444c143b0f877ead7b76fcc53fd4060f0 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Mon, 18 Sep 2023 09:31:50 +0100 Subject: [PATCH] Create initial crates --- Cargo.lock | 6 +++++- Cargo.toml | 10 ++-------- csg/Cargo.toml | 8 ++++++++ csg/src/lib.rs | 14 ++++++++++++++ editor/Cargo.toml | 8 ++++++++ {src => editor/src}/main.rs | 0 6 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 csg/Cargo.toml create mode 100644 csg/src/lib.rs create mode 100644 editor/Cargo.toml rename {src => editor/src}/main.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 62aebd5..83c8aa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5 +3,9 @@ version = 3 [[package]] -name = "csg_forge" +name = "csg" +version = "0.1.0" + +[[package]] +name = "editor" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index ddcc0f4..e5d4fda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,2 @@ -[package] -name = "csg_forge" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] +[workspace] +members = ["csg", "editor"] diff --git a/csg/Cargo.toml b/csg/Cargo.toml new file mode 100644 index 0000000..30d1a4a --- /dev/null +++ b/csg/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "csg" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/csg/src/lib.rs b/csg/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/csg/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/editor/Cargo.toml b/editor/Cargo.toml new file mode 100644 index 0000000..f430d3f --- /dev/null +++ b/editor/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "editor" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/main.rs b/editor/src/main.rs similarity index 100% rename from src/main.rs rename to editor/src/main.rs