mirror of
https://github.com/chronotope/chrono.git
synced 2025-09-28 21:42:01 +00:00
chore: apply clippy suggestions for 1.65
This commit is contained in:
parent
280208499e
commit
645fca0c55
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user