Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. mod delicious_snacks {
  2. use self::fruits::PEAR as fruit;
  3. use self::veggies::CUCUMBER as veggie;
  4.  
  5. mod fruits {
  6. pub const PEAR: &'static str = "Pear";
  7. pub const APPLE: &'static str = "Apple";
  8. }
  9.  
  10. mod veggies {
  11. pub const CUCUMBER: &'static str = "Cucumber";
  12. pub const CARROT: &'static str = "Carrot";
  13. }
  14. }
  15.  
  16. fn main() {
  17. println!(
  18. "favorite snacks: {} and {}",
  19. delicious_snacks::fruit,
  20. delicious_snacks::veggie
  21. );
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement