SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. enum Valore {
  2.     Esempio, Ciao, Prova
  3. }
  4.  
  5. fn handle_esempio(fai_qualcosa:i32){
  6.     /* qualcosa*/
  7. }
  8.  
  9. fn handle_ciao(fai_qualcosa:i32){
  10.     /* qualcosa*/
  11. }
  12.  
  13. fn handle_prova(fai_qualcosa:i32){
  14.     /* qualcosa*/
  15. }
  16.  
  17. fn main(){
  18.     let valore = Valore::Esempio;
  19.     let param = 5;
  20.     match valore {
  21.         Valore::Esempio => handle_esempio(param),
  22.         Valore::Ciao => handle_ciao(param),
  23.         Valore::Prova => handle_prova(param)
  24.     }
  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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top