From 59a57fa2f9c9aa1e19ab6405d8868072c46571e1 Mon Sep 17 00:00:00 2001 From: Nils Fenner Date: Mon, 20 Nov 2023 14:15:22 +0100 Subject: [PATCH 1/3] fix tokio feature dependencies --- Cargo.toml | 1 + tox_core/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8dea5efc..190b006d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "tox", "tox_binary_io", diff --git a/tox_core/Cargo.toml b/tox_core/Cargo.toml index 877ea177..2bcf715d 100644 --- a/tox_core/Cargo.toml +++ b/tox_core/Cargo.toml @@ -39,7 +39,7 @@ crypto_box = "0.8" [dependencies.tokio] version = "1.28" default-features = false -features = ["net", "sync", "time"] +features = ["net", "rt", "sync", "time"] [dependencies.tokio-util] version = "0.7" From 25ead2781443ea890a471f816b72769ebd9d694e Mon Sep 17 00:00:00 2001 From: Nils Fenner Date: Mon, 20 Nov 2023 14:32:32 +0100 Subject: [PATCH 2/3] add rt-multi-thread feature dependency --- tox_core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox_core/Cargo.toml b/tox_core/Cargo.toml index 2bcf715d..231a2941 100644 --- a/tox_core/Cargo.toml +++ b/tox_core/Cargo.toml @@ -39,7 +39,7 @@ crypto_box = "0.8" [dependencies.tokio] version = "1.28" default-features = false -features = ["net", "rt", "sync", "time"] +features = ["net", "rt", "rt-multi-thread", "sync", "time"] [dependencies.tokio-util] version = "0.7" From 6ee6996d589700d5057d651330025569c89f64c5 Mon Sep 17 00:00:00 2001 From: Nils Fenner Date: Tue, 21 Nov 2023 13:05:02 +0100 Subject: [PATCH 3/3] Add crate_version functions --- tox/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tox/src/lib.rs b/tox/src/lib.rs index 13912f1b..b39b0253 100644 --- a/tox/src/lib.rs +++ b/tox/src/lib.rs @@ -4,3 +4,16 @@ pub use tox_core as core; pub use tox_crypto as crypto; pub use tox_encryptsave as encryptsave; pub use tox_packet as packet; + +pub fn crate_version() -> String { + env!("CARGO_PKG_VERSION").to_string() +} +pub fn crate_version_major() -> u32 { + env!("CARGO_PKG_VERSION_MAJOR").parse().expect("Invalid major version") +} +pub fn crate_version_minor() -> u32 { + env!("CARGO_PKG_VERSION_MINOR").parse().expect("Invalid minor version") +} +pub fn crate_version_patch() -> u32 { + env!("CARGO_PKG_VERSION_PATCH").parse().expect("Invalid patch version") +}