@@ -247,9 +247,8 @@ pub fn parse_opts(args: &[~str]) -> OptRes {
247
247
let ratchet_metrics = getopts:: opt_maybe_str ( & matches, "ratchet-metrics" ) ;
248
248
let ratchet_metrics = ratchet_metrics. map ( |s| Path ( * s) ) ;
249
249
250
- let ratchet_noise_percent =
251
- getopts:: opt_maybe_str ( & matches, "ratchet-noise-percent" ) ;
252
- let ratchet_noise_percent = ratchet_noise_percent. map ( |s| f64:: from_str ( * s) . get ( ) ) ;
250
+ let ratchet_noise_percent = getopts:: opt_maybe_str ( & matches, "ratchet-noise-percent" ) ;
251
+ let ratchet_noise_percent = ratchet_noise_percent. map ( |s| f64:: from_str ( * s) . unwrap ( ) ) ;
253
252
254
253
let save_metrics = getopts:: opt_maybe_str ( & matches, "save-metrics" ) ;
255
254
let save_metrics = save_metrics. map ( |s| Path ( * s) ) ;
@@ -631,8 +630,8 @@ fn should_sort_failures_before_printing_them() {
631
630
st. write_failures ( ) ;
632
631
} ;
633
632
634
- let apos = s. find_str ( "a" ) . get ( ) ;
635
- let bpos = s. find_str ( "b" ) . get ( ) ;
633
+ let apos = s. find_str ( "a" ) . unwrap ( ) ;
634
+ let bpos = s. find_str ( "b" ) . unwrap ( ) ;
636
635
assert ! ( apos < bpos) ;
637
636
}
638
637
@@ -868,7 +867,7 @@ impl MetricMap {
868
867
pub fn load ( p : & Path ) -> MetricMap {
869
868
assert ! ( os:: path_exists( p) ) ;
870
869
let f = io:: file_reader ( p) . unwrap ( ) ;
871
- let mut decoder = json:: Decoder ( json:: from_reader ( f) . get ( ) ) ;
870
+ let mut decoder = json:: Decoder ( json:: from_reader ( f) . unwrap ( ) ) ;
872
871
MetricMap ( Decodable :: decode ( & mut decoder) )
873
872
}
874
873
@@ -1207,7 +1206,7 @@ mod tests {
1207
1206
either:: Left ( o) => o,
1208
1207
_ => fail ! ( "Malformed arg in first_free_arg_should_be_a_filter" )
1209
1208
} ;
1210
- assert ! ( "filter" == opts. filter. clone( ) . get ( ) ) ;
1209
+ assert ! ( "filter" == opts. filter. clone( ) . unwrap ( ) ) ;
1211
1210
}
1212
1211
1213
1212
#[ test]
@@ -1346,28 +1345,28 @@ mod tests {
1346
1345
1347
1346
let diff1 = m2.compare_to_old(&m1, None);
1348
1347
1349
- assert_eq!(*(diff1.find(&~" in-both-noise").get ()), LikelyNoise);
1350
- assert_eq!(*(diff1.find(&~" in-first-noise").get ()), MetricRemoved);
1351
- assert_eq!(*(diff1.find(&~" in-second-noise").get ()), MetricAdded);
1352
- assert_eq!(*(diff1.find(&~" in-both-want-downwards-but-regressed").get ()),
1348
+ assert_eq!(*(diff1.find(&~" in-both-noise").unwrap ()), LikelyNoise);
1349
+ assert_eq!(*(diff1.find(&~" in-first-noise").unwrap ()), MetricRemoved);
1350
+ assert_eq!(*(diff1.find(&~" in-second-noise").unwrap ()), MetricAdded);
1351
+ assert_eq!(*(diff1.find(&~" in-both-want-downwards-but-regressed").unwrap ()),
1353
1352
Regression(100.0));
1354
- assert_eq!(*(diff1.find(&~" in-both-want-downwards-and-improved").get ()),
1353
+ assert_eq!(*(diff1.find(&~" in-both-want-downwards-and-improved").unwrap ()),
1355
1354
Improvement(50.0));
1356
- assert_eq!(*(diff1.find(&~" in-both-want-upwards-but-regressed").get ()),
1355
+ assert_eq!(*(diff1.find(&~" in-both-want-upwards-but-regressed").unwrap ()),
1357
1356
Regression(50.0));
1358
- assert_eq!(*(diff1.find(&~" in-both-want-upwards-and-improved").get ()),
1357
+ assert_eq!(*(diff1.find(&~" in-both-want-upwards-and-improved").unwrap ()),
1359
1358
Improvement(100.0));
1360
1359
assert_eq!(diff1.len(), 7);
1361
1360
1362
1361
let diff2 = m2.compare_to_old(&m1, Some(200.0));
1363
1362
1364
- assert_eq!(*(diff2.find(&~" in-both-noise").get ()), LikelyNoise);
1365
- assert_eq!(*(diff2.find(&~" in-first-noise").get ()), MetricRemoved);
1366
- assert_eq!(*(diff2.find(&~" in-second-noise").get ()), MetricAdded);
1367
- assert_eq!(*(diff2.find(&~" in-both-want-downwards-but-regressed").get ()), LikelyNoise);
1368
- assert_eq!(*(diff2.find(&~" in-both-want-downwards-and-improved").get ()), LikelyNoise);
1369
- assert_eq!(*(diff2.find(&~" in-both-want-upwards-but-regressed").get ()), LikelyNoise);
1370
- assert_eq!(*(diff2.find(&~" in-both-want-upwards-and-improved").get ()), LikelyNoise);
1363
+ assert_eq!(*(diff2.find(&~" in-both-noise").unwrap ()), LikelyNoise);
1364
+ assert_eq!(*(diff2.find(&~" in-first-noise").unwrap ()), MetricRemoved);
1365
+ assert_eq!(*(diff2.find(&~" in-second-noise").unwrap ()), MetricAdded);
1366
+ assert_eq!(*(diff2.find(&~" in-both-want-downwards-but-regressed").unwrap ()), LikelyNoise);
1367
+ assert_eq!(*(diff2.find(&~" in-both-want-downwards-and-improved").unwrap ()), LikelyNoise);
1368
+ assert_eq!(*(diff2.find(&~" in-both-want-upwards-but-regressed").unwrap ()), LikelyNoise);
1369
+ assert_eq!(*(diff2.find(&~" in-both-want-upwards-and-improved").unwrap ()), LikelyNoise);
1371
1370
assert_eq!(diff2.len(), 7);
1372
1371
}
1373
1372
@@ -1391,28 +1390,28 @@ mod tests {
1391
1390
let (diff1, ok1) = m2.ratchet(&pth, None);
1392
1391
assert_eq!(ok1, false);
1393
1392
assert_eq!(diff1.len(), 2);
1394
- assert_eq!(*(diff1.find(&~" runtime").get ()), Regression(10.0));
1395
- assert_eq!(*(diff1.find(&~" throughput").get ()), LikelyNoise);
1393
+ assert_eq!(*(diff1.find(&~" runtime").unwrap ()), Regression(10.0));
1394
+ assert_eq!(*(diff1.find(&~" throughput").unwrap ()), LikelyNoise);
1396
1395
1397
1396
// Check that it was not rewritten.
1398
1397
let m3 = MetricMap::load(&pth);
1399
1398
assert_eq!(m3.len(), 2);
1400
- assert_eq!(*(m3.find(&~" runtime").get ()), Metric { value: 1000.0, noise: 2.0 });
1401
- assert_eq!(*(m3.find(&~" throughput").get ()), Metric { value: 50.0, noise: 2.0 });
1399
+ assert_eq!(*(m3.find(&~" runtime").unwrap ()), Metric { value: 1000.0, noise: 2.0 });
1400
+ assert_eq!(*(m3.find(&~" throughput").unwrap ()), Metric { value: 50.0, noise: 2.0 });
1402
1401
1403
1402
// Ask for a ratchet with an explicit noise-percentage override,
1404
1403
// that should advance.
1405
1404
let (diff2, ok2) = m2.ratchet(&pth, Some(10.0));
1406
1405
assert_eq!(ok2, true);
1407
1406
assert_eq!(diff2.len(), 2);
1408
- assert_eq!(*(diff2.find(&~" runtime").get ()), LikelyNoise);
1409
- assert_eq!(*(diff2.find(&~" throughput").get ()), LikelyNoise);
1407
+ assert_eq!(*(diff2.find(&~" runtime").unwrap ()), LikelyNoise);
1408
+ assert_eq!(*(diff2.find(&~" throughput").unwrap ()), LikelyNoise);
1410
1409
1411
1410
// Check that it was rewritten.
1412
1411
let m4 = MetricMap::load(&pth);
1413
1412
assert_eq!(m4.len(), 2);
1414
- assert_eq!(*(m4.find(&~" runtime").get ()), Metric { value: 1100.0, noise: 2.0 });
1415
- assert_eq!(*(m4.find(&~" throughput") . get ( ) ) , Metric { value: 50.0 , noise: 2.0 } ) ;
1413
+ assert_eq!(*(m4.find(&~" runtime").unwrap ()), Metric { value: 1100.0, noise: 2.0 });
1414
+ assert_eq!(*(m4.find(&~" throughput") . unwrap ( ) ) , Metric { value: 50.0 , noise: 2.0 } ) ;
1416
1415
1417
1416
os:: remove_dir_recursive ( & dpth) ;
1418
1417
}
0 commit comments