Skip to content

Commit 8a6a129

Browse files
committed
Remove save() and load().
1 parent 27b3e14 commit 8a6a129

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/libtest/lib.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,14 @@ use self::OutputLocation::*;
5454
use stats::Stats;
5555
use getopts::{OptGroup, optflag, optopt};
5656
use regex::Regex;
57-
use serialize::{json, Decodable, Encodable};
57+
use serialize::Encodable;
5858
use term::Terminal;
5959
use term::color::{Color, RED, YELLOW, GREEN, CYAN};
6060

6161
use std::any::Any;
6262
use std::cmp;
6363
use std::collections::BTreeMap;
6464
use std::fmt;
65-
use std::io::fs::PathExtensions;
6665
use std::io::stdio::StdWriter;
6766
use std::io::{File, ChanReader, ChanWriter};
6867
use std::io;
@@ -990,30 +989,6 @@ impl MetricMap {
990989
MetricMap(BTreeMap::new())
991990
}
992991

993-
/// Load MetricDiff from a file.
994-
///
995-
/// # Panics
996-
///
997-
/// This function will panic if the path does not exist or the path does not
998-
/// contain a valid metric map.
999-
pub fn load(p: &Path) -> MetricMap {
1000-
assert!(p.exists());
1001-
let mut f = File::open(p).unwrap();
1002-
let value = json::from_reader(&mut f as &mut io::Reader).unwrap();
1003-
let mut decoder = json::Decoder::new(value);
1004-
MetricMap(match Decodable::decode(&mut decoder) {
1005-
Ok(t) => t,
1006-
Err(e) => panic!("failure decoding JSON: {:?}", e)
1007-
})
1008-
}
1009-
1010-
/// Write MetricDiff to a file.
1011-
pub fn save(&self, p: &Path) -> io::IoResult<()> {
1012-
let mut file = try!(File::create(p));
1013-
let MetricMap(ref map) = *self;
1014-
write!(&mut file, "{}", json::as_json(map))
1015-
}
1016-
1017992
/// Insert a named `value` (+/- `noise`) metric into the map. The value
1018993
/// must be non-negative. The `noise` indicates the uncertainty of the
1019994
/// metric, which doubles as the "noise range" of acceptable

0 commit comments

Comments
 (0)