# HG changeset patch # User unc0rr # Date 1539534199 -7200 # Node ID 3f05761577492e09902531ef4132cdd0e3d70db1 # Parent e26573441808df4e4ea7f0b731616c65468207bc Implement Iterator trait for LaggedFibonacciPRNG diff -r e26573441808 -r 3f0576157749 rust/lfprng/src/lib.rs --- a/rust/lfprng/src/lib.rs Sun Oct 14 18:01:58 2018 +0200 +++ b/rust/lfprng/src/lib.rs Sun Oct 14 18:23:19 2018 +0200 @@ -46,6 +46,15 @@ } } +impl Iterator for LaggedFibonacciPRNG { + type Item = u32; + + fn next(&mut self) -> Option { + self.get_next(); + Some(self.get_next()) + } +} + #[cfg(test)] #[test] fn compatibility() {