Skip to content

Commit 27a20a8

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 162269 b: refs/heads/auto c: 8379d72 h: refs/heads/master i: 162267: 38a8e91 v: v3
1 parent 3bc19fc commit 27a20a8

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 98ae63753bc6c2efe1c8ed50d45e665db686cde7
13+
refs/heads/auto: 8379d722933eff4831fc38e158a7238a9e2d8984
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libgetopts/lib.rs

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -962,19 +962,19 @@ mod tests {
962962
match rs {
963963
Ok(ref m) => {
964964
assert!(m.opt_present("test"));
965-
assert_eq!(m.opt_str("test").unwrap(), "20".to_string());
965+
assert_eq!(m.opt_str("test").unwrap(), "20");
966966
assert!(m.opt_present("t"));
967-
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
967+
assert_eq!(m.opt_str("t").unwrap(), "20");
968968
}
969969
_ => { panic!("test_reqopt failed (long arg)"); }
970970
}
971971
let short_args = vec!("-t".to_string(), "20".to_string());
972972
match getopts(short_args.as_slice(), opts.as_slice()) {
973973
Ok(ref m) => {
974974
assert!((m.opt_present("test")));
975-
assert_eq!(m.opt_str("test").unwrap(), "20".to_string());
975+
assert_eq!(m.opt_str("test").unwrap(), "20");
976976
assert!((m.opt_present("t")));
977-
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
977+
assert_eq!(m.opt_str("t").unwrap(), "20");
978978
}
979979
_ => { panic!("test_reqopt failed (short arg)"); }
980980
}
@@ -1027,19 +1027,19 @@ mod tests {
10271027
match rs {
10281028
Ok(ref m) => {
10291029
assert!(m.opt_present("test"));
1030-
assert_eq!(m.opt_str("test").unwrap(), "20".to_string());
1030+
assert_eq!(m.opt_str("test").unwrap(), "20");
10311031
assert!((m.opt_present("t")));
1032-
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
1032+
assert_eq!(m.opt_str("t").unwrap(), "20");
10331033
}
10341034
_ => panic!()
10351035
}
10361036
let short_args = vec!("-t".to_string(), "20".to_string());
10371037
match getopts(short_args.as_slice(), opts.as_slice()) {
10381038
Ok(ref m) => {
10391039
assert!((m.opt_present("test")));
1040-
assert_eq!(m.opt_str("test").unwrap(), "20".to_string());
1040+
assert_eq!(m.opt_str("test").unwrap(), "20");
10411041
assert!((m.opt_present("t")));
1042-
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
1042+
assert_eq!(m.opt_str("t").unwrap(), "20");
10431043
}
10441044
_ => panic!()
10451045
}
@@ -1154,7 +1154,7 @@ mod tests {
11541154
Ok(ref m) => {
11551155
// The next variable after the flag is just a free argument
11561156

1157-
assert!(m.free[0] == "20".to_string());
1157+
assert!(m.free[0] == "20");
11581158
}
11591159
_ => panic!()
11601160
}
@@ -1250,19 +1250,19 @@ mod tests {
12501250
match rs {
12511251
Ok(ref m) => {
12521252
assert!((m.opt_present("test")));
1253-
assert_eq!(m.opt_str("test").unwrap(), "20".to_string());
1253+
assert_eq!(m.opt_str("test").unwrap(), "20");
12541254
assert!((m.opt_present("t")));
1255-
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
1255+
assert_eq!(m.opt_str("t").unwrap(), "20");
12561256
}
12571257
_ => panic!()
12581258
}
12591259
let short_args = vec!("-t".to_string(), "20".to_string());
12601260
match getopts(short_args.as_slice(), opts.as_slice()) {
12611261
Ok(ref m) => {
12621262
assert!((m.opt_present("test")));
1263-
assert_eq!(m.opt_str("test").unwrap(), "20".to_string());
1263+
assert_eq!(m.opt_str("test").unwrap(), "20");
12641264
assert!((m.opt_present("t")));
1265-
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
1265+
assert_eq!(m.opt_str("t").unwrap(), "20");
12661266
}
12671267
_ => panic!()
12681268
}
@@ -1306,12 +1306,12 @@ mod tests {
13061306
match rs {
13071307
Ok(ref m) => {
13081308
assert!(m.opt_present("test"));
1309-
assert_eq!(m.opt_str("test").unwrap(), "20".to_string());
1309+
assert_eq!(m.opt_str("test").unwrap(), "20");
13101310
assert!(m.opt_present("t"));
1311-
assert_eq!(m.opt_str("t").unwrap(), "20".to_string());
1311+
assert_eq!(m.opt_str("t").unwrap(), "20");
13121312
let pair = m.opt_strs("test");
1313-
assert!(pair[0] == "20".to_string());
1314-
assert!(pair[1] == "30".to_string());
1313+
assert!(pair[0] == "20");
1314+
assert!(pair[1] == "30");
13151315
}
13161316
_ => panic!()
13171317
}
@@ -1363,19 +1363,19 @@ mod tests {
13631363
let rs = getopts(args.as_slice(), opts.as_slice());
13641364
match rs {
13651365
Ok(ref m) => {
1366-
assert!(m.free[0] == "prog".to_string());
1367-
assert!(m.free[1] == "free1".to_string());
1368-
assert_eq!(m.opt_str("s").unwrap(), "20".to_string());
1369-
assert!(m.free[2] == "free2".to_string());
1366+
assert!(m.free[0] == "prog");
1367+
assert!(m.free[1] == "free1");
1368+
assert_eq!(m.opt_str("s").unwrap(), "20");
1369+
assert!(m.free[2] == "free2");
13701370
assert!((m.opt_present("flag")));
1371-
assert_eq!(m.opt_str("long").unwrap(), "30".to_string());
1371+
assert_eq!(m.opt_str("long").unwrap(), "30");
13721372
assert!((m.opt_present("f")));
13731373
let pair = m.opt_strs("m");
1374-
assert!(pair[0] == "40".to_string());
1375-
assert!(pair[1] == "50".to_string());
1374+
assert!(pair[0] == "40");
1375+
assert!(pair[1] == "50");
13761376
let pair = m.opt_strs("n");
1377-
assert!(pair[0] == "-A B".to_string());
1378-
assert!(pair[1] == "-60 70".to_string());
1377+
assert!(pair[0] == "-A B");
1378+
assert!(pair[1] == "-60 70");
13791379
assert!((!m.opt_present("notpresent")));
13801380
}
13811381
_ => panic!()
@@ -1401,11 +1401,11 @@ mod tests {
14011401
assert!(!matches_single.opts_present(&["thing".to_string()]));
14021402
assert!(!matches_single.opts_present(&[]));
14031403

1404-
assert_eq!(matches_single.opts_str(&["e".to_string()]).unwrap(), "foo".to_string());
1404+
assert_eq!(matches_single.opts_str(&["e".to_string()]).unwrap(), "foo");
14051405
assert_eq!(matches_single.opts_str(&["e".to_string(), "encrypt".to_string()]).unwrap(),
1406-
"foo".to_string());
1406+
"foo");
14071407
assert_eq!(matches_single.opts_str(&["encrypt".to_string(), "e".to_string()]).unwrap(),
1408-
"foo".to_string());
1408+
"foo");
14091409

14101410
let args_both = vec!("-e".to_string(), "foo".to_string(), "--encrypt".to_string(),
14111411
"foo".to_string());
@@ -1422,12 +1422,12 @@ mod tests {
14221422
assert!(!matches_both.opts_present(&["thing".to_string()]));
14231423
assert!(!matches_both.opts_present(&[]));
14241424

1425-
assert_eq!(matches_both.opts_str(&["e".to_string()]).unwrap(), "foo".to_string());
1426-
assert_eq!(matches_both.opts_str(&["encrypt".to_string()]).unwrap(), "foo".to_string());
1425+
assert_eq!(matches_both.opts_str(&["e".to_string()]).unwrap(), "foo");
1426+
assert_eq!(matches_both.opts_str(&["encrypt".to_string()]).unwrap(), "foo");
14271427
assert_eq!(matches_both.opts_str(&["e".to_string(), "encrypt".to_string()]).unwrap(),
1428-
"foo".to_string());
1428+
"foo");
14291429
assert_eq!(matches_both.opts_str(&["encrypt".to_string(), "e".to_string()]).unwrap(),
1430-
"foo".to_string());
1430+
"foo");
14311431
}
14321432

14331433
#[test]
@@ -1440,9 +1440,9 @@ mod tests {
14401440
result::Err(_) => panic!()
14411441
};
14421442
assert!(matches.opts_present(&["L".to_string()]));
1443-
assert_eq!(matches.opts_str(&["L".to_string()]).unwrap(), "foo".to_string());
1443+
assert_eq!(matches.opts_str(&["L".to_string()]).unwrap(), "foo");
14441444
assert!(matches.opts_present(&["M".to_string()]));
1445-
assert_eq!(matches.opts_str(&["M".to_string()]).unwrap(), ".".to_string());
1445+
assert_eq!(matches.opts_str(&["M".to_string()]).unwrap(), ".");
14461446

14471447
}
14481448

@@ -1456,7 +1456,7 @@ mod tests {
14561456
result::Err(e) => panic!( "{}", e )
14571457
};
14581458
assert!(matches.opts_present(&["L".to_string()]));
1459-
assert_eq!(matches.opts_str(&["L".to_string()]).unwrap(), "verbose".to_string());
1459+
assert_eq!(matches.opts_str(&["L".to_string()]).unwrap(), "verbose");
14601460
assert!(matches.opts_present(&["v".to_string()]));
14611461
assert_eq!(3, matches.opt_count("v"));
14621462
}
@@ -1510,7 +1510,7 @@ Options:
15101510
-k --kiwi Desc
15111511
-p [VAL] Desc
15121512
-l VAL Desc
1513-
".to_string();
1513+
";
15141514

15151515
let generated_usage = usage("Usage: fruits", optgroups.as_slice());
15161516

@@ -1537,7 +1537,7 @@ Options:
15371537
-k --kiwi This is a long description which won't be wrapped..+..
15381538
-a --apple This is a long description which _will_ be
15391539
wrapped..+..
1540-
".to_string();
1540+
";
15411541

15421542
let usage = usage("Usage: fruits", optgroups.as_slice());
15431543

@@ -1563,7 +1563,7 @@ Options:
15631563
-a --apple This “description” has some characters that could
15641564
confuse the line wrapping; an apple costs 0.51€ in
15651565
some parts of Europe.
1566-
".to_string();
1566+
";
15671567

15681568
let usage = usage("Usage: fruits", optgroups.as_slice());
15691569

0 commit comments

Comments
 (0)