Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This takes the commits from #1163 that simplify and optimize our formatting code a bit. #1335 took the initial refactor from that PR, so now we can take the more interesting part.
Two commits make better use of
match
to only accept a formatting item if we also have the date/time/offset fields it needs, instead of usingmap
inside a match arm.The last commit introduces a couple of optimized number formatting functions. They are the trick that makes our formatting implementations for RFC 2822 and 3339 faster, so lets use them for regular formatting too 😄.
Benchmarks