From 90728f9f9a129abe36caad2b93f60260b79d5695 Mon Sep 17 00:00:00 2001 From: Melfely Date: Thu, 10 Sep 2026 09:57:37 -0500 Subject: [PATCH] fix: changed to cargo workspace rather than single project folder --- Cargo.lock | 6 +++++- Cargo.toml | 9 +++------ example_bin/Cargo.toml | 6 ++++++ example_bin/src/main.rs | 3 +++ example_lib/Cargo.toml | 6 ++++++ example_lib/src/lib.rs | 14 ++++++++++++++ src/lib.rs | 3 --- 7 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 example_bin/Cargo.toml create mode 100644 example_bin/src/main.rs create mode 100644 example_lib/Cargo.toml create mode 100644 example_lib/src/lib.rs delete mode 100644 src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 8686ddb..3bc11c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5 +3,9 @@ version = 4 [[package]] -name = "temp" +name = "example_bin" +version = "0.1.0" + +[[package]] +name = "example_lib" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 927feba..73ca508 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,3 @@ -[package] -name = "temp" -version = "0.1.0" -edition = "2024" - -[dependencies] +[workspace] +resolver = "3" +members = ["example_bin","example_lib"] diff --git a/example_bin/Cargo.toml b/example_bin/Cargo.toml new file mode 100644 index 0000000..d734bc5 --- /dev/null +++ b/example_bin/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "example_bin" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/example_bin/src/main.rs b/example_bin/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/example_bin/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/example_lib/Cargo.toml b/example_lib/Cargo.toml new file mode 100644 index 0000000..2794f7e --- /dev/null +++ b/example_lib/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "example_lib" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/example_lib/src/lib.rs b/example_lib/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/example_lib/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 6d21af3..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub fn two() -> i32 { - 2 -}