summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-10-23 08:42:21 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-10-30 08:54:30 -0700
commit1d356624a1c03363be37886ffdad7dcf25ee81f6 (patch)
tree4aef71be9e3f509b1bc8b4880e6894656e6404c4 /src/libtest
parent18a3db6aa1ce9e66b0c9cb776588d56470c6078b (diff)
downloadrust-1d356624a1c03363be37886ffdad7dcf25ee81f6.tar.gz
rust-1d356624a1c03363be37886ffdad7dcf25ee81f6.zip
collections: Enable IndexMut for some collections
This commit enables implementations of IndexMut for a number of collections,
including Vec, RingBuf, SmallIntMap, TrieMap, TreeMap, and HashMap. At the same
time this deprecates the `get_mut` methods on vectors in favor of using the
indexing notation.

cc #18424
Diffstat (limited to 'src/libtest')
-rw-r--r--src/libtest/stats.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs
index 72c61f3afc7..21cf1d11e80 100644
--- a/src/libtest/stats.rs
+++ b/src/libtest/stats.rs
@@ -185,7 +185,7 @@ impl<'a, T: FloatMath + FromPrimitive> Stats<T> for &'a [T] {
                 let hi = x + y;
                 let lo = y - (hi - x);
                 if !lo.is_zero() {
-                    *partials.get_mut(j) = lo;
+                    partials[j] = lo;
                     j += 1;
                 }
                 x = hi;
@@ -193,7 +193,7 @@ impl<'a, T: FloatMath + FromPrimitive> Stats<T> for &'a [T] {
             if j >= partials.len() {
                 partials.push(x);
             } else {
-                *partials.get_mut(j) = x;
+                partials[j] = x;
                 partials.truncate(j+1);
             }
         }