Guest User

Untitled

a guest
Apr 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. fn main() {
  2.  
  3. // Gives you your snack
  4. fn getting_fed() {
  5. let s = "apple";
  6. println!("Can't wait to eat this {}!!!", s);
  7. }
  8.  
  9. getting_fed();
  10.  
  11. // Also gives you your snack
  12. fn getting_hungry() {
  13. let s = {
  14. if 1 > 0 {
  15. "pear"
  16. } else {
  17. "no pear"
  18. }
  19. };
  20. println!("Can't wait to eat this {}!!!", s);
  21. }
  22.  
  23. getting_hungry();
  24.  
  25. // Gives NO SNAX
  26. fn getting_starving(){
  27. let s = {
  28. if 1 > 0 {
  29. "banana"
  30. } else {
  31. "no banana"
  32. };
  33. };
  34. println!("Can't wait to eat this {:?}!!!", s);
  35. }
  36.  
  37. getting_starving();
  38.  
  39. }
Add Comment
Please, Sign In to add comment