Skip to content

Commit

Permalink
Don't require to depend directly on paste crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Varlakov committed Dec 12, 2020
1 parent 62da573 commit a7b5511
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ crate-type = ["lib"]
[features]
default = []
# Exposes utils useful for testing
testing-utils = []
testing-utils = ["paste"]

[dependencies]
rand = "0.6"
Expand All @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>]() {
Expand Down Expand Up @@ -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;

0 comments on commit a7b5511

Please sign in to comment.