about summary refs log tree commit diff
path: root/src/libtest/lib.rs
diff options
context:
space:
mode:
authorAhmed Charles <acharles@outlook.com>2015-01-21 02:31:15 -0800
committerAhmed Charles <acharles@outlook.com>2015-01-22 00:56:10 -0800
commit8a6a129aec86341a2b066a338a78b9e5509137c5 (patch)
tree61eb2ba5d2404a5eb9a8dc1d457ad2cddcd64700 /src/libtest/lib.rs
parent27b3e14d7fa5f6e07f38ca174daed489edcfc113 (diff)
downloadrust-8a6a129aec86341a2b066a338a78b9e5509137c5.tar.gz
rust-8a6a129aec86341a2b066a338a78b9e5509137c5.zip
Remove save() and load().
Diffstat (limited to 'src/libtest/lib.rs')
-rw-r--r--src/libtest/lib.rs27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index 86a92f0ac8f..e1ae87475ca 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -54,7 +54,7 @@ use self::OutputLocation::*;
 use stats::Stats;
 use getopts::{OptGroup, optflag, optopt};
 use regex::Regex;
-use serialize::{json, Decodable, Encodable};
+use serialize::Encodable;
 use term::Terminal;
 use term::color::{Color, RED, YELLOW, GREEN, CYAN};
 
@@ -62,7 +62,6 @@ use std::any::Any;
 use std::cmp;
 use std::collections::BTreeMap;
 use std::fmt;
-use std::io::fs::PathExtensions;
 use std::io::stdio::StdWriter;
 use std::io::{File, ChanReader, ChanWriter};
 use std::io;
@@ -990,30 +989,6 @@ impl MetricMap {
         MetricMap(BTreeMap::new())
     }
 
-    /// Load MetricDiff from a file.
-    ///
-    /// # Panics
-    ///
-    /// This function will panic if the path does not exist or the path does not
-    /// contain a valid metric map.
-    pub fn load(p: &Path) -> MetricMap {
-        assert!(p.exists());
-        let mut f = File::open(p).unwrap();
-        let value = json::from_reader(&mut f as &mut io::Reader).unwrap();
-        let mut decoder = json::Decoder::new(value);
-        MetricMap(match Decodable::decode(&mut decoder) {
-            Ok(t) => t,
-            Err(e) => panic!("failure decoding JSON: {:?}", e)
-        })
-    }
-
-    /// Write MetricDiff to a file.
-    pub fn save(&self, p: &Path) -> io::IoResult<()> {
-        let mut file = try!(File::create(p));
-        let MetricMap(ref map) = *self;
-        write!(&mut file, "{}", json::as_json(map))
-    }
-
     /// Insert a named `value` (+/- `noise`) metric into the map. The value
     /// must be non-negative. The `noise` indicates the uncertainty of the
     /// metric, which doubles as the "noise range" of acceptable