SHARE
TWEET

Untitled

a guest Apr 21st, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #[derive(Debug)]
  2. struct Foo(u32);
  3.  
  4.  
  5. impl Foo {
  6.     fn succ(self) -> Self {
  7.         Self(self.0 + 1)
  8.     }
  9. }
  10.  
  11. fn main() {
  12.     (0..4).fold(Foo(0), |f, _| { println!("{:?}",f); f.succ() });
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top