Skip to content

Commit

Permalink
error comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Nov 22, 2024
1 parent ba7d7c2 commit 1655266
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/datetime/src/neo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,10 @@ impl Writeable for FormattedDateTime<'_> {
self.names.fixed_decimal_formatter,
sink,
);
// There should not be an error. If there is, return the lossy string.
// A DateTimeWriteError should not occur in normal usage because DateTimeFormatter
// guarantees that all names for the pattern have been loaded and that the input type
// is compatible with the pattern. However, this code path might be reachable with
// invalid data. In that case, debug-panic and return the fallback string.
match result {
Ok(Ok(())) => Ok(()),
Err(fmt::Error) => Err(fmt::Error),
Expand Down

0 comments on commit 1655266

Please sign in to comment.