From e14282d42afe433ae599a53a0a3906e65ad03401 Mon Sep 17 00:00:00 2001 From: ozaner <56015962+ozaner@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:05:05 -0500 Subject: [PATCH] Cargo skeleton Boilerplate from running `cargo init --lib`, and `cargo build`. Also added Cargo.lock to .gitignore (this is a library crate). --- .gitignore | 2 ++ Cargo.toml | 8 ++++++++ src/lib.rs | 14 ++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 src/lib.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96ef6c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..e3020a4 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "zorua" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[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); + } +}