diff options
| author | bors <bors@rust-lang.org> | 2013-08-03 02:10:54 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-03 02:10:54 -0700 |
| commit | 39fafd655a85a2af9cddf59b70a687b44570fb6f (patch) | |
| tree | d977784abeff9fa49b6085578495359731dc11bd /src/rt/sync/timer.cpp | |
| parent | 20fad0f5fff381210bfe79b35a5fe8332ec86b34 (diff) | |
| parent | aa94dfa625e0d19cd322d7816167486ece53397d (diff) | |
| download | rust-39fafd655a85a2af9cddf59b70a687b44570fb6f.tar.gz rust-39fafd655a85a2af9cddf59b70a687b44570fb6f.zip | |
auto merge of #8204 : kballard/rust/str-into-owned, r=graydon
The method .into_owned() is meant to be used as an optimization when you need to get a ~str from a Str, but don't want to unnecessarily copy it if it's already a ~str. This is meant to ease functions that look like fn foo<S: Str>(strs: &[S]) Previously they could work with the strings as slices using .as_slice(), but producing ~str required copying the string, even if the vector turned out be a &[~str] already. I don't have any concrete uses for this yet, since the one conversion I've done to `&[S]` so far (see PR #8203) didn't actually need owned strings. But having this here may make using `Str` more attractive. It also may be worth adding an `into_managed()` function, but that one is less obviously useful than `into_owned()`.
Diffstat (limited to 'src/rt/sync/timer.cpp')
0 files changed, 0 insertions, 0 deletions
