From ad556ba0c74927f9a4d1672bb2e25137f58c68b9 Mon Sep 17 00:00:00 2001 From: mengfansheng Date: Sat, 11 May 2024 14:30:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20r=5Farrayfunc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utshell-0.4/Cargo.toml | 3 ++- utshell-0.4/r_arrayfunc/Cargo.toml | 8 ++++++++ utshell-0.4/r_arrayfunc/src/lib.rs | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 utshell-0.4/r_arrayfunc/Cargo.toml create mode 100644 utshell-0.4/r_arrayfunc/src/lib.rs diff --git a/utshell-0.4/Cargo.toml b/utshell-0.4/Cargo.toml index 34340311..49c15672 100644 --- a/utshell-0.4/Cargo.toml +++ b/utshell-0.4/Cargo.toml @@ -95,7 +95,8 @@ members=[ "r_pcomplib", "r_array", "r_bracecomp", - "r_variables" + "r_variables", + "r_arrayfunc" ] [dependencies] diff --git a/utshell-0.4/r_arrayfunc/Cargo.toml b/utshell-0.4/r_arrayfunc/Cargo.toml new file mode 100644 index 00000000..4888f8bd --- /dev/null +++ b/utshell-0.4/r_arrayfunc/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "r_arrayfunc" +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/utshell-0.4/r_arrayfunc/src/lib.rs b/utshell-0.4/r_arrayfunc/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/utshell-0.4/r_arrayfunc/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); + } +} -- Gitee