diff options
| author | bors <bors@rust-lang.org> | 2014-09-22 05:30:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-22 05:30:30 +0000 |
| commit | cbb07e81be99271f9e240a27dcf540686d8c0bfc (patch) | |
| tree | a0a2ce0e5d9e65137f445201cbcd01324ca0d275 /src/libtest | |
| parent | 4e5b62618cb5341139177c1ef62e2467affd041f (diff) | |
| parent | 0169218047dc989acf9ea25e3122b9c659acb6b3 (diff) | |
| download | rust-cbb07e81be99271f9e240a27dcf540686d8c0bfc.tar.gz rust-cbb07e81be99271f9e240a27dcf540686d8c0bfc.zip | |
auto merge of #17029 : alexcrichton/rust/vec-stable, r=aturon
The following methods, types, and names have become stable: * Vec * Vec::as_mut_slice * Vec::as_slice * Vec::capacity * Vec::clear * Vec::default * Vec::grow * Vec::insert * Vec::len * Vec::new * Vec::pop * Vec::push * Vec::remove * Vec::set_len * Vec::shrink_to_fit * Vec::truncate * Vec::with_capacity * vec::raw * vec::raw::from_buf * vec::raw::from_raw_parts The following have become unstable: * Vec::dedup // naming * Vec::from_fn // naming and unboxed closures * Vec::get_mut // will be removed for IndexMut * Vec::grow_fn // unboxed closures and naming * Vec::retain // unboxed closures * Vec::swap_remove // uncertain naming * Vec::from_elem // uncertain semantics * vec::unzip // should be generic for all collections The following have been deprecated * Vec::append - call .extend() * Vec::append_one - call .push() * Vec::from_slice - call .to_vec() * Vec::grow_set - call .grow() and then .push() * Vec::into_vec - move the vector instead * Vec::move_iter - renamed to iter_move() * Vec::push_all - call .extend() * Vec::to_vec - call .clone() * Vec:from_raw_parts - moved to raw::from_raw_parts This is a breaking change in terms of the signature of the `Vec::grow` function. The argument used to be taken by reference, but it is now taken by value. Code must update by removing a leading `&` sigil or by calling `.clone()` to create a value. [breaking-change]
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/stats.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 7087d4c4238..ae70bb4b792 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -261,13 +261,13 @@ impl<'a, T: FloatMath + FromPrimitive> Stats<T> for &'a [T] { } fn percentile(self, pct: T) -> T { - let mut tmp = Vec::from_slice(self); + let mut tmp = self.to_vec(); local_sort(tmp.as_mut_slice()); percentile_of_sorted(tmp.as_slice(), pct) } fn quartiles(self) -> (T,T,T) { - let mut tmp = Vec::from_slice(self); + let mut tmp = self.to_vec(); local_sort(tmp.as_mut_slice()); let first = FromPrimitive::from_uint(25).unwrap(); let a = percentile_of_sorted(tmp.as_slice(), first); @@ -318,7 +318,7 @@ fn percentile_of_sorted<T: Float + FromPrimitive>(sorted_samples: &[T], /// /// See: http://en.wikipedia.org/wiki/Winsorising pub fn winsorize<T: Float + FromPrimitive>(samples: &mut [T], pct: T) { - let mut tmp = Vec::from_slice(samples); + let mut tmp = samples.to_vec(); local_sort(tmp.as_mut_slice()); let lo = percentile_of_sorted(tmp.as_slice(), pct); let hundred: T = FromPrimitive::from_uint(100).unwrap(); |
