]> git.lizzy.rs Git - rust.git/commitdiff
Merge #2006
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Mon, 14 Oct 2019 13:14:18 +0000 (13:14 +0000)
committerGitHub <noreply@github.com>
Mon, 14 Oct 2019 13:14:18 +0000 (13:14 +0000)
2006: Improvements around `Arc<[T]>` r=matklad a=sinkuu

First commit tries to avoid cloning `Arc<[T]>` to a temporary `Vec` for mutating it, if there are no other strong references. Second commit utilizes [`FromIterator for Arc<[T]>`](https://doc.rust-lang.org/std/sync/struct.Arc.html#impl-FromIterator%3CT%3E) instead of `.collect::<Vec<_>>().into()` to avoid allocation in `From<Vec<T>> for Arc<[T]>`.

Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>

Trivial merge