chore: apply clippy suggestions for 1.65

This commit is contained in:
Dirkjan Ochtman 2022-11-04 23:17:41 +01:00
parent 280208499e
commit 645fca0c55
2 changed files with 2 additions and 8 deletions

View File

@ -225,7 +225,7 @@ impl Parsed {
/// (`false` for AM, `true` for PM)
#[inline]
pub fn set_ampm(&mut self, value: bool) -> ParseResult<()> {
set_if_consistent(&mut self.hour_div_12, if value { 1 } else { 0 })
set_if_consistent(&mut self.hour_div_12, u32::from(value))
}
/// Tries to set the [`hour_mod_12`](#structfield.hour_mod_12) field from

View File

@ -652,13 +652,7 @@ impl NaiveTime {
// `secs` may contain a leap second yet to be counted
let adjust = match self.secs.cmp(&rhs.secs) {
Ordering::Greater => {
if rhs.frac >= 1_000_000_000 {
1
} else {
0
}
}
Ordering::Greater => i64::from(rhs.frac >= 1_000_000_000),
Ordering::Equal => 0,
Ordering::Less => {
if self.frac >= 1_000_000_000 {