From 40a7305fa03508e05bef02105cf9e7e96b340e9f Mon Sep 17 00:00:00 2001 From: Guus van Meerveld Date: Thu, 18 Apr 2024 15:47:34 +0200 Subject: [PATCH] started on basic library --- .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 3 +++ sshn-lib/Cargo.toml | 8 ++++++++ sshn-lib/src/lib.rs | 14 ++++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 sshn-lib/Cargo.toml create mode 100644 sshn-lib/src/lib.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..3a25f9a --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "sshn-lib" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..f26bed1 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] + +members = ["sshn-lib"] diff --git a/sshn-lib/Cargo.toml b/sshn-lib/Cargo.toml new file mode 100644 index 0000000..a6b0ff7 --- /dev/null +++ b/sshn-lib/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "sshn-lib" +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/sshn-lib/src/lib.rs b/sshn-lib/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/sshn-lib/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); + } +}