diff --git a/Cargo.toml b/Cargo.toml index 34f83f3..b1bd9c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ reactive_stores = "0.1.1" strum = "0.26.3" strum_macros = "0.26.4" serde_json = "1.0.133" +src-common = { path = "./src-common" } [workspace] -members = ["src-tauri"] +members = ["src-common", "src-tauri"] diff --git a/src-common/Cargo.toml b/src-common/Cargo.toml new file mode 100644 index 0000000..02696e7 --- /dev/null +++ b/src-common/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "src-common" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/src-common/src/lib.rs b/src-common/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/src-common/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-tauri/Cargo.toml b/src-tauri/Cargo.toml index e17464d..6768082 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -29,3 +29,4 @@ thiserror = "2.0.8" directories = "5.0.1" indoc = "2.0.5" open = "5.3.1" +src-common = { path = "../src-common" }