From 7bc09aaed4a14ae9963499e3812a3004be8d84ae Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 11 Nov 2024 03:11:39 +0100 Subject: [PATCH] `nodeinfo`: Create crate --- Cargo.toml | 2 +- acrate-nodeinfo/Cargo.toml | 11 +++++++++++ acrate-nodeinfo/src/lib.rs | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 acrate-nodeinfo/Cargo.toml create mode 100644 acrate-nodeinfo/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 053f9fe..86f0e07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] resolver = "2" -members = ["acrate-core", "acrate-hostmeta"] +members = ["acrate-core", "acrate-hostmeta", "acrate-nodeinfo"] diff --git a/acrate-nodeinfo/Cargo.toml b/acrate-nodeinfo/Cargo.toml new file mode 100644 index 0000000..9caaee0 --- /dev/null +++ b/acrate-nodeinfo/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "acrate-nodeinfo" +version = "0.1.0" +edition = "2021" + +[dependencies] +log = "0.4.22" + +[dev-dependencies] +pretty_env_logger = "0.5.0" +tokio = { version = "1.41.1", features = ["macros", "rt-multi-thread"] } diff --git a/acrate-nodeinfo/src/lib.rs b/acrate-nodeinfo/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/acrate-nodeinfo/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}