From bc9189651046bf3bab1f43a8aaa54226115ea248 Mon Sep 17 00:00:00 2001 From: Zach Dziura Date: Tue, 10 May 2016 23:30:18 -0400 Subject: [PATCH] v1.0.1 Fixed issue where the wrapped "Int" member of "Prime" was marked as private, rather than public. --- Cargo.toml | 2 +- src/lib.rs | 5 +++++ src/prime.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3aec427..b2f1fb8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pumpkin" -version = "1.0.0" +version = "1.0.1" authors = ["Zach Dziura "] description = "A cryptographically secure prime number generator" repository = "https://github.com/zcdziura/pumpkin" diff --git a/src/lib.rs b/src/lib.rs index 15dfbdf..3430f40 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,6 +60,11 @@ mod tests { Prime::from_rng(511, &mut rngesus); } + #[test] + fn test_should_destructure() { + let Prime(n) = Prime::new(512); + } + #[bench] fn bench_generate_512_bit_prime(b: &mut Bencher) { b.iter(|| Prime::new(512)); diff --git a/src/prime.rs b/src/prime.rs index 1be1d96..5b1a73d 100644 --- a/src/prime.rs +++ b/src/prime.rs @@ -137,7 +137,7 @@ custom_derive! { NewtypeBitAnd(Int), NewtypeBitOr, NewtypeBitOr(Int), NewtypeBitXor, NewtypeBitXor(Int) )] - pub struct Prime(Int); + pub struct Prime(pub Int); } impl Prime {