Skip to content

Commit b6f27d6

Browse files
committed
Inline floating point rounding fallback
1 parent 63bcf11 commit b6f27d6

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

time/src/parsing/iso8601.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -315,19 +315,13 @@ fn round(value: f64) -> f64 {
315315
}
316316
#[cfg(not(feature = "std"))]
317317
{
318-
round_impl(value)
319-
}
320-
}
318+
debug_assert!(value.is_sign_positive() && !value.is_nan());
321319

322-
#[cfg(not(feature = "std"))]
323-
#[expect(clippy::missing_docs_in_private_items)]
324-
fn round_impl(value: f64) -> f64 {
325-
debug_assert!(value.is_sign_positive() && !value.is_nan());
326-
327-
let f = value % 1.;
328-
if f < 0.5 {
329-
value - f
330-
} else {
331-
value - f + 1.
320+
let f = value % 1.;
321+
if f < 0.5 {
322+
value - f
323+
} else {
324+
value - f + 1.
325+
}
332326
}
333327
}

0 commit comments

Comments
 (0)