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 {