]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #18556 : seanmonstar/rust/tm-fmt, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 8 Nov 2014 07:06:36 +0000 (07:06 +0000)
committerbors <bors@rust-lang.org>
Sat, 8 Nov 2014 07:06:36 +0000 (07:06 +0000)
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]


Trivial merge