SHARE
TWEET

Untitled

a guest Jun 19th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #[derive(Debug, Copy, Clone, PartialEq)]
  2. pub enum Val {
  3.     Val(usize),
  4.     Mine,
  5. }
  6.  
  7. fn main() {
  8.     let mut v = Val::Val(0);
  9.     println!("{:?}", v);
  10.  
  11.     if let Val::Val(x) = &mut v {
  12.         *x += 1;
  13.     }
  14.  
  15.     println!("{:?}", v);
  16. }
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