From f421ee9371294e36eae47339a3e81e1dfb41f75c Mon Sep 17 00:00:00 2001 From: wangmengc Date: Mon, 3 Jun 2024 09:54:05 +0800 Subject: [PATCH] add r_input lib --- utshell-0.5/Cargo.toml | 5 +++-- utshell-0.5/r_input/Cargo.toml | 8 ++++++++ utshell-0.5/r_input/src/lib.rs | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 utshell-0.5/r_input/Cargo.toml create mode 100644 utshell-0.5/r_input/src/lib.rs diff --git a/utshell-0.5/Cargo.toml b/utshell-0.5/Cargo.toml index eb71a808..b4ccb0a5 100644 --- a/utshell-0.5/Cargo.toml +++ b/utshell-0.5/Cargo.toml @@ -98,7 +98,8 @@ members=[ "r_variables", "r_arrayfunc", "r_error", - "r_expr", + "r_expr", + "r_input", ] [dependencies] @@ -177,7 +178,7 @@ members=[ r_variables = {path = "./r_variables"} r_error = {path = "./r_error"} r_expr = {path = "./r_expr"} - + r_input = {path = "./r_input"} intl_pluralrules = "7.0.2" tinystr = "=0.7.1" diff --git a/utshell-0.5/r_input/Cargo.toml b/utshell-0.5/r_input/Cargo.toml new file mode 100644 index 00000000..3ecf3b51 --- /dev/null +++ b/utshell-0.5/r_input/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "r_input" +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.5/r_input/src/lib.rs b/utshell-0.5/r_input/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/utshell-0.5/r_input/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