rollup merge of #20377: alexcrichton/issue-20352

This commit is contained in:
Alex Crichton
2015-01-02 09:16:26 -08:00
25 changed files with 320 additions and 359 deletions

View File

@@ -171,14 +171,14 @@ impl TestFn {
impl fmt::Show for TestFn {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write(match *self {
f.write_str(match *self {
StaticTestFn(..) => "StaticTestFn(..)",
StaticBenchFn(..) => "StaticBenchFn(..)",
StaticMetricFn(..) => "StaticMetricFn(..)",
DynTestFn(..) => "DynTestFn(..)",
DynMetricFn(..) => "DynMetricFn(..)",
DynBenchFn(..) => "DynBenchFn(..)"
}.as_bytes())
})
}
}
@@ -1212,8 +1212,7 @@ impl MetricMap {
pub fn save(&self, p: &Path) -> io::IoResult<()> {
let mut file = try!(File::create(p));
let MetricMap(ref map) = *self;
let mut enc = json::PrettyEncoder::new(&mut file);
map.encode(&mut enc)
write!(&mut file, "{}", json::as_json(map))
}
/// Compare against another MetricMap. Optionally compare all