about summary refs log tree commit diff
path: root/src/libtest/stats.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtest/stats.rs')
-rw-r--r--src/libtest/stats.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs
index bdc05a50301..1abb52459e4 100644
--- a/src/libtest/stats.rs
+++ b/src/libtest/stats.rs
@@ -13,7 +13,7 @@
 use std::cmp::Ordering::{self, Less, Greater, Equal};
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 use std::collections::hash_map;
-use std::fmt::Show;
+use std::fmt;
 use std::hash::Hash;
 use std::io;
 use std::mem;
@@ -333,7 +333,7 @@ pub fn winsorize<T: Float + FromPrimitive>(samples: &mut [T], pct: T) {
 }
 
 /// Render writes the min, max and quartiles of the provided `Summary` to the provided `Writer`.
-pub fn write_5_number_summary<W: Writer, T: Float + Show>(w: &mut W,
+pub fn write_5_number_summary<W: Writer, T: Float + fmt::String + fmt::Show>(w: &mut W,
                                                           s: &Summary<T>) -> io::IoResult<()> {
     let (q1,q2,q3) = s.quartiles;
     write!(w, "(min={}, q1={}, med={}, q3={}, max={})",
@@ -355,7 +355,7 @@ pub fn write_5_number_summary<W: Writer, T: Float + Show>(w: &mut W,
 /// ```{.ignore}
 ///   10 |        [--****#******----------]          | 40
 /// ```
-pub fn write_boxplot<W: Writer, T: Float + Show + FromPrimitive>(
+pub fn write_boxplot<W: Writer, T: Float + fmt::String + fmt::Show + FromPrimitive>(
                      w: &mut W,
                      s: &Summary<T>,
                      width_hint: uint)
@@ -444,7 +444,7 @@ pub fn freq_count<T, U>(mut iter: T) -> hash_map::HashMap<U, uint>
 {
     let mut map: hash_map::HashMap<U,uint> = hash_map::HashMap::new();
     for elem in iter {
-        match map.entry(&elem) {
+        match map.entry(elem) {
             Occupied(mut entry) => { *entry.get_mut() += 1; },
             Vacant(entry) => { entry.insert(1); },
         }