Fixed issue where the wrapped "Int" member of "Prime" was marked as
private, rather than public.
This commit is contained in:
Zach Dziura 2016-05-10 23:30:18 -04:00
parent a60c1f63a1
commit bc91896510
3 changed files with 7 additions and 2 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "pumpkin" name = "pumpkin"
version = "1.0.0" version = "1.0.1"
authors = ["Zach Dziura <zcdziura@gmail.com>"] authors = ["Zach Dziura <zcdziura@gmail.com>"]
description = "A cryptographically secure prime number generator" description = "A cryptographically secure prime number generator"
repository = "https://github.com/zcdziura/pumpkin" repository = "https://github.com/zcdziura/pumpkin"

View file

@ -60,6 +60,11 @@ mod tests {
Prime::from_rng(511, &mut rngesus); Prime::from_rng(511, &mut rngesus);
} }
#[test]
fn test_should_destructure() {
let Prime(n) = Prime::new(512);
}
#[bench] #[bench]
fn bench_generate_512_bit_prime(b: &mut Bencher) { fn bench_generate_512_bit_prime(b: &mut Bencher) {
b.iter(|| Prime::new(512)); b.iter(|| Prime::new(512));

View file

@ -137,7 +137,7 @@ custom_derive! {
NewtypeBitAnd(Int), NewtypeBitOr, NewtypeBitOr(Int), NewtypeBitXor, NewtypeBitAnd(Int), NewtypeBitOr, NewtypeBitOr(Int), NewtypeBitXor,
NewtypeBitXor(Int) NewtypeBitXor(Int)
)] )]
pub struct Prime(Int); pub struct Prime(pub Int);
} }
impl Prime { impl Prime {