mirror of https://github.com/01-edu/public.git
1bc3b5d6dd | ||
---|---|---|
.. | ||
README.md |
README.md
middle_day
Instructions
Use the chrono
crate to create a function named middle_day
. It accepts a year, and returns the weekday of the middle day of that year, wrapped in an Option
. chrono::Weekday
has to be referred to as wd
.
Years with an even number of days do not have a middle day, and should return None
.
Expected Function
You'll need to work out the function signature for yourself.
Usage
Here is a program to test your function:
use middle_day::*;
fn main() {
println!("{:?}", middle_day(1022).unwrap());
}
And its output:
$ cargo run
Tue
$