From a7b5511139c1582c8d81797f44132fae485cce78 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Sat, 12 Dec 2020 16:05:16 +0700 Subject: [PATCH] Don't require to depend directly on `paste` crate --- Cargo.toml | 3 ++- src/lib.rs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cc4327ec..893550e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ crate-type = ["lib"] [features] default = [] # Exposes utils useful for testing -testing-utils = [] +testing-utils = ["paste"] [dependencies] rand = "0.6" @@ -27,6 +27,7 @@ digest = "0.8.1" hex = "^0.3" blake2b_simd = "0.5.7" derivative = "2.1.1" +paste = { version = "1.0.2", optional = true } [dependencies.rust-gmp-kzen] version = "0.5.0" diff --git a/src/lib.rs b/src/lib.rs index a21aca34..6624ac81 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -101,7 +101,7 @@ macro_rules! test_for_all_curves { $crate::test_for_all_curves!([] $fn); }; ([$($attrs:tt)*] $fn: ident) => { - paste::paste!{ + $crate::paste!{ #[test] $($attrs)* fn [<$fn _secp256k1>]() { @@ -130,3 +130,8 @@ macro_rules! test_for_all_curves { } }; } + +/// Re-exporting macro to use in `test_for_all_curves!` +#[cfg(any(test, feature = "testing-utils"))] +#[doc(hidden)] +pub use paste::paste;