// Don't check for `None`, as the error from year-month-day will always take priority. iflet Some(ParsedItem(input, ordinal)) = dayo(input) {
*parsed = try_likely_ok!(
try_likely_ok!(parsed.with_year(year).ok_or(InvalidComponent("year")))
.with_ordinal(ordinal)
.ok_or(InvalidComponent("ordinal"))
); return Ok(input);
}
let parsed_week_weekday = (|| { let input =
try_likely_ok!(ascii_char::<b'W'>(input).ok_or((false, InvalidLiteral)))
.into_inner(); let ParsedItem(mut input, week) =
try_likely_ok!(week(input).ok_or((true, InvalidComponent("week")))); if extended_kind.is_extended() {
input = try_likely_ok!(ascii_char::<b'-'>(input).ok_or((true, InvalidLiteral)))
.into_inner();
} let ParsedItem(input, weekday) =
try_likely_ok!(dayk(input).ok_or((true, InvalidComponent("weekday"))));
Ok(ParsedItem(input, (week, weekday)))
})(); match parsed_week_weekday {
Ok(ParsedItem(input, (week, weekday))) => {
*parsed = try_likely_ok!(
try_likely_ok!(
try_likely_ok!(
parsed.with_iso_year(year).ok_or(InvalidComponent("year"))
)
.with_iso_week_number(week)
.ok_or(InvalidComponent("week"))
)
.with_weekday(weekday)
.ok_or(InvalidComponent("weekday"))
); return Ok(input);
}
Err((false, _err)) => {} // This error is more accurate than the one from year-month-day.
Err((true, err)) => ret_error = err,
}
Err(ret_error.into())
}
}
// Basic: ["T"][hour][min][sec] // Extended: ["T"][hour][":"][min][":"][sec] // Reduced precision: components after [hour] (including their preceding separator) can be // omitted. ["T"] can be omitted if there is no date present. /// Parse a time in the basic or extended format. Reduced precision is permitted. pub(crate) fn parse_time<'a>(
parsed: &'a mut Parsed,
extended_kind: &'a mut ExtendedKind,
date_is_present: bool,
) -> impl FnMut(&[u8]) -> Result<&[u8], error::Parse> + use<'a, CONFIG> { move |mut input| { if date_is_present {
input =
try_likely_ok!(ascii_char::<b'T'>(input).ok_or(InvalidLiteral)).into_inner();
}
// If `:` was present, the format has already been set to extended. As such, this call // will do nothing in that case. If there wasn't `:` but minutes were // present, we know it's the basic format. Do not use `?` on the call, as // returning `None` is valid behavior.
extended_kind.coerce_basic();
Ok(input)
}
}
}
/// Round wrapper that uses hardware implementation if `std` is available, falling back to manual /// implementation for `no_std` #[inline] fn round(value: f64) -> f64 { #[cfg(feature = "std")]
{
value.round()
} #[cfg(not(feature = "std"))]
{
debug_assert!(value.is_sign_positive() && !value.is_nan());
let f = value % 1.; if f < 0.5 { value - f } else { value - f + 1. }
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.31 Sekunden
(vorverarbeitet am 2026-08-24)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.