From 81e3c048ff1eae3a7ab64c980eff7b81e3987b7e Mon Sep 17 00:00:00 2001 From: Jia Chao Date: Thu, 13 Jun 2024 15:20:41 +0800 Subject: [PATCH] cargo init --lib Signed-off-by: Jia Chao --- .gitignore | 12 ++++++++++++ Cargo.toml | 6 ++++++ src/lib.rs | 14 ++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 Cargo.toml create mode 100644 src/lib.rs diff --git a/.gitignore b/.gitignore index 3ca43ae..e7180de 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,15 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb + + +# Added by cargo + +/target + + +# Added by cargo +# +# already existing elements were commented out + +#/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c87f807 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "updateinfo-xmlparser" +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); + } +}