Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mod day1 {
- use super::utils;
- pub(crate) fn day() -> &'static str {
- utils::dayname(5)
- }
- }
- mod utils {
- pub(crate) fn dayname(n: usize) -> &'static str {
- [
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- "Sunday",
- ][n]
- }
- }
- fn main() {
- // I don't need a use here, because the day1 module lives at the main root.
- println!("{}", day1::day())
- }
Add Comment
Please, Sign In to add comment