fn days_in_month(year: u16, month: u8) -> Option<u8> {
    match month {
        // April, June, Septemper, November
        4 | 6 | 9 | 11 => Some(30),
        // January, March, May, July, August, October, December
        1 | 3 | 5 | 7 | 8 | 10 | 12 => Some(31),
        // February
        2 => Some(if is_leap_year(year) { 29 } else { 28 }),
        // Not a real month
        _ => None,
    }
}
/// Determine the number of days in a month
Determine the number of days in a month
Determine the number of days in a month
fn days_in_month(year: u16, month: u8) -> Option<u8> {
    match month {
        // April, June, Septemper, November
        4 | 6 | 9 | 11 => Some(30),
        // January, March, May, July, August, October, December
        1 | 3 | 5 | 7 | 8 | 10 | 12 => Some(31),
        // February
        2 => Some(if is_leap_year(year) { 29 } else { 28 }),
        // Not a real month
        _ => None,
    }
}
fn days_in_month ( year : u16 , month : u8 ) -> Option < u8 > { match month { // April, June, Septemper, November 4 | 6 | 9 | 11 => Some ( 30 ) , // January, March, May, July, August, October, December 1 | 3 | 5 | 7 | 8 | 10 | 12 => Some ( 31 ) , // February 2 => Some ( if is_leap_year ( year ) { 29 } else { 28 } ) , // Not a real month _ => None , } }
Determine the number of days in a month
Determine the number of days in a month
year
u16
month
u8