about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stdio.rs
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-12-06 07:49:01 +0100
committerGitHub <noreply@github.com>2018-12-06 07:49:01 +0100
commite9e92d53ade5767e533338bc6b2aaa70083c30ec (patch)
treeabf1fdf1e56c1f55d60c880e5c046d67299fdf84 /src/libstd/sys/unix/stdio.rs
parent9e7ff567501f48b62a4ee6b441ae4b3d3afcb38e (diff)
parent811a2bfe5332081d7145de6c488ea7f6c5cf42a5 (diff)
downloadrust-e9e92d53ade5767e533338bc6b2aaa70083c30ec.tar.gz
rust-e9e92d53ade5767e533338bc6b2aaa70083c30ec.zip
Rollup merge of #56548 - Lucretiel:string-extend-optimize, r=sfackler
Optimized string FromIterator + Extend impls

I noticed that there was a lost opportunity to reuse string buffers in `FromIterator<String>` and `FromIterator<Cow<str>>`; 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`.
Diffstat (limited to 'src/libstd/sys/unix/stdio.rs')
0 files changed, 0 insertions, 0 deletions