From 64641fae557368b5b32723c60ad92e959854f800 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 9 Nov 2024 00:37:12 +0100 Subject: [PATCH] `core`: Create crate --- Cargo.toml | 4 +--- acrate-core/Cargo.toml | 6 ++++++ acrate-core/src/lib.rs | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 acrate-core/Cargo.toml create mode 100644 acrate-core/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index a892e6a..9de72ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,2 @@ [workspace] -members = [ - -] +members = ["acrate-core"] diff --git a/acrate-core/Cargo.toml b/acrate-core/Cargo.toml new file mode 100644 index 0000000..9a2a66b --- /dev/null +++ b/acrate-core/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "acrate-core" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/acrate-core/src/lib.rs b/acrate-core/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/acrate-core/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); + } +}