fn naive_time_from_components(
    hour: u32,
    minute: u32,
    second: u32,
    micro: u32,
) -> Result<NaiveTime> {
    if hour >= 24 {
        InvalidDateTimeHour { value: hour }.fail()
    } else if minute >= 60 {
        InvalidDateTimeMinute { value: minute }.fail()
    } else if second >= 60 {
        InvalidDateTimeSecond { value: second }.fail()
    } else if micro >= 2_000_000 {
        InvalidDateTimeMicrosecond { value: micro }.fail()
    } else {
        Ok(NaiveTime::from_hms_micro(hour, minute, second, micro))
    }
}
/// A version of `NativeTime::from_hms` which returns a more informative error.
A version of `NativeTime::from_hms` which returns a more informative error.
A version of ` NativeTime :: from_hms ` which returns a more informative error .
fn naive_time_from_components(
    hour: u32,
    minute: u32,
    second: u32,
    micro: u32,
) -> Result<NaiveTime> {
    if hour >= 24 {
        InvalidDateTimeHour { value: hour }.fail()
    } else if minute >= 60 {
        InvalidDateTimeMinute { value: minute }.fail()
    } else if second >= 60 {
        InvalidDateTimeSecond { value: second }.fail()
    } else if micro >= 2_000_000 {
        InvalidDateTimeMicrosecond { value: micro }.fail()
    } else {
        Ok(NaiveTime::from_hms_micro(hour, minute, second, micro))
    }
}
fn naive_time_from_components ( hour : u32 , minute : u32 , second : u32 , micro : u32 , ) -> Result < NaiveTime > { if hour >= 24 { InvalidDateTimeHour { value : hour } . fail ( ) } else if minute >= 60 { InvalidDateTimeMinute { value : minute } . fail ( ) } else if second >= 60 { InvalidDateTimeSecond { value : second } . fail ( ) } else if micro >= 2_000_000 { InvalidDateTimeMicrosecond { value : micro } . fail ( ) } else { Ok ( NaiveTime :: from_hms_micro ( hour , minute , second , micro ) ) } }
A version of `NativeTime::from_hms` which returns a more informative error.
A version of ` NativeTime :: from_hms ` which returns a more informative error .
hour
u32
minute
u32
second
u32
micro
u32
hour
u32
minute
u32
second
u32
micro
u32