From 166f366650b1b28319b5c58ff1a5f4592b6e9a5d Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Sat, 17 Aug 2024 01:05:41 +0000 Subject: [PATCH] added basic library files --- Cargo.toml | 6 ++++++ src/lib.rs | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Cargo.toml create mode 100644 src/lib.rs diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..7b593d9 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "vcs-common" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/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); + } +}