Skip to content

Commit afd657e

Browse files
committed
auto merge of #18556 : seanmonstar/rust/tm-fmt, r=alexcrichton
The internals of strftime were converted to use a single formatter, instead of creating and concatenating a bunch of small strings. This showed ~3x improvement in the benches. Also, since the formatted time may be going straight to a Writer, TmFmt was introduced, and is returned from all formatting methods on Tm. This allows the saving of another string allocation. Anyone wanting a String can just call .to_string() on the returned value. This runs validation prior to return the created `TmFmt`, catching errors before formatting happens. The specialized formats skip this validation, since we already know they are valid. [breaking-change]
2 parents 7bc3588 + 7ddf8cb commit afd657e

File tree

1 file changed

+454
-320
lines changed

1 file changed

+454
-320
lines changed

0 commit comments

Comments
 (0)