mirror of
https://github.com/chronotope/chrono.git
synced 2025-10-04 16:25:54 +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)
|
/// (`false` for AM, `true` for PM)
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_ampm(&mut self, value: bool) -> ParseResult<()> {
|
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
|
/// 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
|
// `secs` may contain a leap second yet to be counted
|
||||||
let adjust = match self.secs.cmp(&rhs.secs) {
|
let adjust = match self.secs.cmp(&rhs.secs) {
|
||||||
Ordering::Greater => {
|
Ordering::Greater => i64::from(rhs.frac >= 1_000_000_000),
|
||||||
if rhs.frac >= 1_000_000_000 {
|
|
||||||
1
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ordering::Equal => 0,
|
Ordering::Equal => 0,
|
||||||
Ordering::Less => {
|
Ordering::Less => {
|
||||||
if self.frac >= 1_000_000_000 {
|
if self.frac >= 1_000_000_000 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user