diff options
| author | Kevin Ballard <kevin@sb.org> | 2014-05-03 22:20:39 -0700 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2014-05-08 12:06:21 -0700 |
| commit | 001a8741b42be9fed5521d9a5a96cf1ea7269fbb (patch) | |
| tree | f969ff3b70aef214613be2c5b9a448b9bcf547eb /src/libstd/sync | |
| parent | 11613fc1c048f5bec4cf792397a15bdd17dfd797 (diff) | |
| download | rust-001a8741b42be9fed5521d9a5a96cf1ea7269fbb.tar.gz rust-001a8741b42be9fed5521d9a5a96cf1ea7269fbb.zip | |
Handle fallout in iter, option, result, and sync::arc
API changes: - UnsafeArc::newN() returns Vec<UnsafeArc<T>>
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/arc.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sync/arc.rs b/src/libstd/sync/arc.rs index d277c514e44..676c836c459 100644 --- a/src/libstd/sync/arc.rs +++ b/src/libstd/sync/arc.rs @@ -69,14 +69,14 @@ impl<T: Send> UnsafeArc<T> { /// As new(), but returns a vector of as many pre-cloned handles as /// requested. - pub fn newN(data: T, num_handles: uint) -> ~[UnsafeArc<T>] { + pub fn newN(data: T, num_handles: uint) -> Vec<UnsafeArc<T>> { unsafe { if num_handles == 0 { - box [] // need to free data here + vec![] // need to free data here } else { let ptr = new_inner(data, num_handles); let v = Vec::from_fn(num_handles, |_| UnsafeArc { data: ptr }); - v.move_iter().collect() + v } } } |
