<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/liballoc/string.rs, branch 1.33.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.33.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.33.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2018-12-26T04:08:33+00:00</updated>
<entry>
<title>Remove licenses</title>
<updated>2018-12-26T04:08:33+00:00</updated>
<author>
<name>Mark Rousskov</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2018-12-25T15:56:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2a663555ddf36f6b041445894a8c175cd1bc718c'/>
<id>urn:sha1:2a663555ddf36f6b041445894a8c175cd1bc718c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix typo</title>
<updated>2018-12-09T21:10:20+00:00</updated>
<author>
<name>BeatButton</name>
<email>thebeatbutton@gmail.com</email>
</author>
<published>2018-12-09T21:10:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6f288ea33712b34c8eabcd57bb10607ab01f0cdb'/>
<id>urn:sha1:6f288ea33712b34c8eabcd57bb10607ab01f0cdb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #56548 - Lucretiel:string-extend-optimize, r=sfackler</title>
<updated>2018-12-06T06:49:01+00:00</updated>
<author>
<name>Pietro Albini</name>
<email>pietro@pietroalbini.org</email>
</author>
<published>2018-12-06T06:49:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e9e92d53ade5767e533338bc6b2aaa70083c30ec'/>
<id>urn:sha1:e9e92d53ade5767e533338bc6b2aaa70083c30ec</id>
<content type='text'>
Optimized string FromIterator + Extend impls

I noticed that there was a lost opportunity to reuse string buffers in `FromIterator&lt;String&gt;` and `FromIterator&lt;Cow&lt;str&gt;&gt;`; updated the implementations to use these. In practice this translates to at least one fewer allocation when using these APIs.

Additionally, rewrote `Extend` implementations to use `iter.for_each`, which (supposedly) helps the compiler optimize those loops (because iterator adapters are encouraged to provide optimized implementations of `fold` and `try_fold`.
</content>
</entry>
<entry>
<title>Added explainatory comments</title>
<updated>2018-12-06T01:46:03+00:00</updated>
<author>
<name>Nathan West</name>
<email>Lucretiel@users.noreply.github.com</email>
</author>
<published>2018-12-06T01:46:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=811a2bfe5332081d7145de6c488ea7f6c5cf42a5'/>
<id>urn:sha1:811a2bfe5332081d7145de6c488ea7f6c5cf42a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed mutability</title>
<updated>2018-12-05T23:11:32+00:00</updated>
<author>
<name>Nathan West</name>
<email>Lucretiel@gmail.com</email>
</author>
<published>2018-12-05T23:11:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=823dd8ca334951962e8b192ca1362c08e33d6bcf'/>
<id>urn:sha1:823dd8ca334951962e8b192ca1362c08e33d6bcf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Optimized string FromIterator impls</title>
<updated>2018-12-05T22:51:04+00:00</updated>
<author>
<name>Nathan West</name>
<email>Lucretiel@gmail.com</email>
</author>
<published>2018-12-05T22:37:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=180dcc3118998ebbe390f876df51f85f1b33407a'/>
<id>urn:sha1:180dcc3118998ebbe390f876df51f85f1b33407a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cleanup: remove static lifetimes from consts</title>
<updated>2018-12-04T11:46:10+00:00</updated>
<author>
<name>ljedrz</name>
<email>ljedrz@gmail.com</email>
</author>
<published>2018-12-04T11:46:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d0c64bb29631fc5e5fafbe88374e7e1325b70ba5'/>
<id>urn:sha1:d0c64bb29631fc5e5fafbe88374e7e1325b70ba5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update issue number of `shrink_to` methods to point the tracking issue</title>
<updated>2018-12-02T07:08:08+00:00</updated>
<author>
<name>Hidehito Yabuuchi</name>
<email>hdht.ybuc@gmail.com</email>
</author>
<published>2018-12-02T07:07:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1e18cc916f653d5bea212bddded8960f548a975d'/>
<id>urn:sha1:1e18cc916f653d5bea212bddded8960f548a975d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>String: add a FIXME to from_utf16</title>
<updated>2018-11-21T09:17:54+00:00</updated>
<author>
<name>ljedrz</name>
<email>ljedrz@gmail.com</email>
</author>
<published>2018-11-21T09:17:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=591607d237665857880e16899788517b9b82d414'/>
<id>urn:sha1:591607d237665857880e16899788517b9b82d414</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #55530 - ljedrz:speed_up_String_from_utf16, r=SimonSapin</title>
<updated>2018-11-15T10:04:31+00:00</updated>
<author>
<name>Pietro Albini</name>
<email>pietro@pietroalbini.org</email>
</author>
<published>2018-11-15T10:04:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3b404349407e7a63730078a2d81d6c86f7f965b3'/>
<id>urn:sha1:3b404349407e7a63730078a2d81d6c86f7f965b3</id>
<content type='text'>
Speed up String::from_utf16

Collecting into a `Result` is idiomatic, but not necessarily fast due to rustc not being able to preallocate for the resulting collection. This is fine in case of an error, but IMO we should optimize for the common case, i.e. a successful conversion.

This changes the behavior of `String::from_utf16` from collecting into a `Result` to pushing to a preallocated `String` in a loop.

According to [my simple benchmark](https://gist.github.com/ljedrz/953a3fb74058806519bd4d640d6f65ae) this change makes `String::from_utf16` around **twice** as fast.
</content>
</entry>
</feed>
