rust/lfprng/src/lib.rs
changeset 13904 3f0576157749
parent 13886 b6c35ac1c5ba
child 13935 75eaf7c71789
--- 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<u32> {
+        self.get_next();
+        Some(self.get_next())
+    }
+}
+
 #[cfg(test)]
 #[test]
 fn compatibility() {