File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ impl Parsed {
225225 /// (`false` for AM, `true` for PM)
226226 #[ inline]
227227 pub fn set_ampm ( & mut self , value : bool ) -> ParseResult < ( ) > {
228- set_if_consistent ( & mut self . hour_div_12 , if value { 1 } else { 0 } )
228+ set_if_consistent ( & mut self . hour_div_12 , u32 :: from ( value) )
229229 }
230230
231231 /// Tries to set the [`hour_mod_12`](#structfield.hour_mod_12) field from
Original file line number Diff line number Diff line change @@ -652,13 +652,7 @@ impl NaiveTime {
652652
653653 // `secs` may contain a leap second yet to be counted
654654 let adjust = match self . secs . cmp ( & rhs. secs ) {
655- Ordering :: Greater => {
656- if rhs. frac >= 1_000_000_000 {
657- 1
658- } else {
659- 0
660- }
661- }
655+ Ordering :: Greater => i64:: from ( rhs. frac >= 1_000_000_000 ) ,
662656 Ordering :: Equal => 0 ,
663657 Ordering :: Less => {
664658 if self . frac >= 1_000_000_000 {
You can’t perform that action at this time.
0 commit comments