Guest User

Untitled

a guest
Jan 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. mod day1 {
  2. use super::utils;
  3. pub(crate) fn day() -> &'static str {
  4. utils::dayname(5)
  5. }
  6. }
  7.  
  8. mod utils {
  9. pub(crate) fn dayname(n: usize) -> &'static str {
  10. [
  11. "Monday",
  12. "Tuesday",
  13. "Wednesday",
  14. "Thursday",
  15. "Friday",
  16. "Saturday",
  17. "Sunday",
  18. ][n]
  19. }
  20. }
  21.  
  22. fn main() {
  23. // I don't need a use here, because the day1 module lives at the main root.
  24. println!("{}", day1::day())
  25. }
Add Comment
Please, Sign In to add comment