From d2fcc426ce30ba3cc575949481438fd3069d87f6 Mon Sep 17 00:00:00 2001 From: ray-x Date: Sat, 8 Apr 2023 12:15:46 +1000 Subject: [PATCH] rust sample code --- playground/rust/src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/playground/rust/src/main.rs b/playground/rust/src/main.rs index 876811b..d562115 100755 --- a/playground/rust/src/main.rs +++ b/playground/rust/src/main.rs @@ -22,6 +22,16 @@ fn fun1(x: i32, y: i32) { println!("The value of x is: {}, y {}", x, y); } +impl Iterator for Iter +where Iter: Iterator, +{ + type Item = i32; + fn next(&mut self) -> Option { + Some(42) + } +} + + fn add(left: i32, right: i32) -> i32 { return left + right; }