SHARE
TWEET

Untitled

a guest Jan 16th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::collections::HashMap;
  2.  
  3. #[derive(Debug)]
  4. pub enum Toto {
  5.     Bli,
  6.     Bla,
  7.     Top
  8. }
  9.  
  10. type Env = HashMap<String, Toto>;
  11.  
  12. fn get(key: &String, e: &Env) -> Toto {
  13.     match e.get(key) {
  14.         Some(t) => {
  15.             let x = t.clone();
  16.             println!("{:?}", x);
  17.             x
  18.         },
  19.         None => Toto::Top
  20.     }
  21. }
  22.  
  23. fn main() {
  24.     println!("Hello, world!");
  25. }
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