@@ -54,15 +54,14 @@ use self::OutputLocation::*;
5454use stats:: Stats ;
5555use getopts:: { OptGroup , optflag, optopt} ;
5656use regex:: Regex ;
57- use serialize:: { json , Decodable , Encodable } ;
57+ use serialize:: Encodable ;
5858use term:: Terminal ;
5959use term:: color:: { Color , RED , YELLOW , GREEN , CYAN } ;
6060
6161use std:: any:: Any ;
6262use std:: cmp;
6363use std:: collections:: BTreeMap ;
6464use std:: fmt;
65- use std:: io:: fs:: PathExtensions ;
6665use std:: io:: stdio:: StdWriter ;
6766use std:: io:: { File , ChanReader , ChanWriter } ;
6867use 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