chrono/src/format
Michal Srb 05acc869b9 Accept Borrow<Item> as items
The parse::parse and format::format functions accepted Iterator of owned
Items. While it is sometimes convenient to pass in the owned values,
neither of the functions really need to own them, so references would
be enough. The Borrow trait allows us to pass in Iterator over values,
references, boxes, etc.

According to RFC 1105 this is a minor change, because it shouldn't break
any existing code. And chrono is in pre-1.0 version anyway.

This allows us to remove multiple cloned() calls which speeds up parsing
and formating:

 name                                                 control ns/iter  remove-cloned ns/iter  diff ns/iter   diff %  speedup
 datetime::tests::bench_datetime_from_str             712              582                            -130  -18.26%   x 1.22
 datetime::tests::bench_datetime_parse_from_rfc2822   252              244                              -8   -3.17%   x 1.03
 datetime::tests::bench_datetime_parse_from_rfc3339   242              239                              -3   -1.24%   x 1.01
2019-11-23 23:34:59 +01:00
..
mod.rs Accept Borrow<Item> as items 2019-11-23 23:34:59 +01:00
parse.rs Accept Borrow<Item> as items 2019-11-23 23:34:59 +01:00
parsed.rs Only parse up to max number of digits for nanoseconds w/o dots 2018-06-12 10:51:38 -04:00
scan.rs Don't warn on deprecated trim functions 2019-03-31 19:03:18 -04:00
strftime.rs Use markdown footnotes in strftime docs 2019-11-22 11:30:10 -05:00