@@ -54,15 +54,14 @@ use self::OutputLocation::*;
54
54
use stats:: Stats ;
55
55
use getopts:: { OptGroup , optflag, optopt} ;
56
56
use regex:: Regex ;
57
- use serialize:: { json , Decodable , Encodable } ;
57
+ use serialize:: Encodable ;
58
58
use term:: Terminal ;
59
59
use term:: color:: { Color , RED , YELLOW , GREEN , CYAN } ;
60
60
61
61
use std:: any:: Any ;
62
62
use std:: cmp;
63
63
use std:: collections:: BTreeMap ;
64
64
use std:: fmt;
65
- use std:: io:: fs:: PathExtensions ;
66
65
use std:: io:: stdio:: StdWriter ;
67
66
use std:: io:: { File , ChanReader , ChanWriter } ;
68
67
use std:: io;
@@ -990,30 +989,6 @@ impl MetricMap {
990
989
MetricMap ( BTreeMap :: new ( ) )
991
990
}
992
991
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
-
1017
992
/// Insert a named `value` (+/- `noise`) metric into the map. The value
1018
993
/// must be non-negative. The `noise` indicates the uncertainty of the
1019
994
/// metric, which doubles as the "noise range" of acceptable
0 commit comments