From 782874a62a0cfd55036054f339c945d9344ede4d Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Wed, 19 Feb 2025 18:27:09 +0000 Subject: [PATCH] cargo: init library `txcore` for shared code between server & client --- txcore/Cargo.toml | 6 ++++++ txcore/src/lib.rs | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 txcore/Cargo.toml create mode 100644 txcore/src/lib.rs diff --git a/txcore/Cargo.toml b/txcore/Cargo.toml new file mode 100644 index 0000000..945d74a --- /dev/null +++ b/txcore/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "txcore" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/txcore/src/lib.rs b/txcore/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/txcore/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); + } +}