Skip to content

Commit 645fca0

Browse files
committed
chore: apply clippy suggestions for 1.65
1 parent 2802084 commit 645fca0

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/format/parsed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

src/naive/time/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)