Skip to content

Commit

Permalink
chore: apply clippy suggestions for 1.65
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Nov 9, 2022
1 parent 2802084 commit 645fca0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/format/parsed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions src/naive/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 645fca0

Please sign in to comment.