Skip to content

Commit a535468

Browse files
committed
cargo fmt and cargo clippy
1 parent 95ebedd commit a535468

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/duration.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use crate::{
44
components::{timezone::TzProvider, PlainDateTime, PlainTime},
55
iso::{IsoDateTime, IsoTime},
66
options::{
7-
ArithmeticOverflow, RelativeTo, ResolvedRoundingOptions, RoundingIncrement, RoundingOptions, TemporalUnit, ToStringRoundingOptions
7+
ArithmeticOverflow, RelativeTo, ResolvedRoundingOptions, RoundingIncrement,
8+
RoundingOptions, TemporalUnit, ToStringRoundingOptions,
89
},
910
parsers::{FormattableDuration, Precision},
1011
primitive::FiniteF64,
@@ -815,9 +816,14 @@ pub(crate) fn is_valid_duration(
815816
// in C++ with an implementation of core::remquo() with sufficient bits in the quotient.
816817
// String manipulation will also give an exact result, since the multiplication is by a power of 10.
817818
// Seconds part
818-
let normalized_seconds = (days.0 as i128 * 86_400) + (hours.0 as i128) * 3600 + minutes.0 as i128 * 60 + seconds.0 as i128;
819+
let normalized_seconds = (days.0 as i128 * 86_400)
820+
+ (hours.0 as i128) * 3600
821+
+ minutes.0 as i128 * 60
822+
+ seconds.0 as i128;
819823
// Subseconds part
820-
let normalized_subseconds_parts = (milliseconds.0 as i128 / 1_000) + (microseconds.0 as i128 / 1_000_000) + (nanoseconds.0 as i128 / 1_000_000_000);
824+
let normalized_subseconds_parts = (milliseconds.0 as i128 / 1_000)
825+
+ (microseconds.0 as i128 / 1_000_000)
826+
+ (nanoseconds.0 as i128 / 1_000_000_000);
821827

822828
let normalized_seconds = normalized_seconds + normalized_subseconds_parts;
823829
// 8. If abs(normalizedSeconds) ≥ 2**53, return false.

0 commit comments

Comments
 (0)