diff --git a/.idea/acrate.iml b/.idea/acrate.iml index 8ef4dcf..01a6e70 100644 --- a/.idea/acrate.iml +++ b/.idea/acrate.iml @@ -12,6 +12,7 @@ + diff --git a/Cargo.toml b/Cargo.toml index d528923..1e44dab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] resolver = "2" -members = ["acrate_database", "acrate_rd", "acrate_nodeinfo", "acrate_rdserver"] +members = ["acrate_database", "acrate_rd", "acrate_nodeinfo", "acrate_rdserver", "acrate_utils"] diff --git a/acrate_utils/Cargo.toml b/acrate_utils/Cargo.toml new file mode 100644 index 0000000..099c1d6 --- /dev/null +++ b/acrate_utils/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "acrate_utils" +version = "0.3.0" +authors = ["Stefano Pigozzi "] +edition = "2021" +description = "Utilities for the acrate project" +repository = "https://forge.steffo.eu/unimore/tirocinio-canali-steffo-acrate" +license = "EUPL-1.2" +keywords = [] +categories = [] + +[dependencies] +axum = { version = "0.7.7", features = ["macros"] } +axum-extra = { version = "0.9.4", features = ["query"] } +log = { version = "0.4.22", features = ["std", "max_level_trace", "release_max_level_debug"] } +pretty_env_logger = "0.5.0" +mediatype = { version = "0.19.18", features = ["serde"] } + +[lints.clippy] +tabs-in-doc-comments = "allow" diff --git a/acrate_utils/src/lib.rs b/acrate_utils/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/acrate_utils/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); + } +}