@@ -962,19 +962,19 @@ mod tests {
962
962
match rs {
963
963
Ok ( ref m) => {
964
964
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" ) ;
966
966
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" ) ;
968
968
}
969
969
_ => { panic ! ( "test_reqopt failed (long arg)" ) ; }
970
970
}
971
971
let short_args = vec ! ( "-t" . to_string( ) , "20" . to_string( ) ) ;
972
972
match getopts ( short_args. as_slice ( ) , opts. as_slice ( ) ) {
973
973
Ok ( ref m) => {
974
974
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" ) ;
976
976
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" ) ;
978
978
}
979
979
_ => { panic ! ( "test_reqopt failed (short arg)" ) ; }
980
980
}
@@ -1027,19 +1027,19 @@ mod tests {
1027
1027
match rs {
1028
1028
Ok ( ref m) => {
1029
1029
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" ) ;
1031
1031
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" ) ;
1033
1033
}
1034
1034
_ => panic ! ( )
1035
1035
}
1036
1036
let short_args = vec ! ( "-t" . to_string( ) , "20" . to_string( ) ) ;
1037
1037
match getopts ( short_args. as_slice ( ) , opts. as_slice ( ) ) {
1038
1038
Ok ( ref m) => {
1039
1039
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" ) ;
1041
1041
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" ) ;
1043
1043
}
1044
1044
_ => panic ! ( )
1045
1045
}
@@ -1154,7 +1154,7 @@ mod tests {
1154
1154
Ok ( ref m) => {
1155
1155
// The next variable after the flag is just a free argument
1156
1156
1157
- assert ! ( m. free[ 0 ] == "20" . to_string ( ) ) ;
1157
+ assert ! ( m. free[ 0 ] == "20" ) ;
1158
1158
}
1159
1159
_ => panic ! ( )
1160
1160
}
@@ -1250,19 +1250,19 @@ mod tests {
1250
1250
match rs {
1251
1251
Ok ( ref m) => {
1252
1252
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" ) ;
1254
1254
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" ) ;
1256
1256
}
1257
1257
_ => panic ! ( )
1258
1258
}
1259
1259
let short_args = vec ! ( "-t" . to_string( ) , "20" . to_string( ) ) ;
1260
1260
match getopts ( short_args. as_slice ( ) , opts. as_slice ( ) ) {
1261
1261
Ok ( ref m) => {
1262
1262
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" ) ;
1264
1264
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" ) ;
1266
1266
}
1267
1267
_ => panic ! ( )
1268
1268
}
@@ -1306,12 +1306,12 @@ mod tests {
1306
1306
match rs {
1307
1307
Ok ( ref m) => {
1308
1308
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" ) ;
1310
1310
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" ) ;
1312
1312
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" ) ;
1315
1315
}
1316
1316
_ => panic ! ( )
1317
1317
}
@@ -1363,19 +1363,19 @@ mod tests {
1363
1363
let rs = getopts ( args. as_slice ( ) , opts. as_slice ( ) ) ;
1364
1364
match rs {
1365
1365
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" ) ;
1370
1370
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" ) ;
1372
1372
assert ! ( ( m. opt_present( "f" ) ) ) ;
1373
1373
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" ) ;
1376
1376
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" ) ;
1379
1379
assert ! ( ( !m. opt_present( "notpresent" ) ) ) ;
1380
1380
}
1381
1381
_ => panic ! ( )
@@ -1401,11 +1401,11 @@ mod tests {
1401
1401
assert ! ( !matches_single. opts_present( & [ "thing" . to_string( ) ] ) ) ;
1402
1402
assert ! ( !matches_single. opts_present( & [ ] ) ) ;
1403
1403
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" ) ;
1405
1405
assert_eq ! ( matches_single. opts_str( & [ "e" . to_string( ) , "encrypt" . to_string( ) ] ) . unwrap( ) ,
1406
- "foo" . to_string ( ) ) ;
1406
+ "foo" ) ;
1407
1407
assert_eq ! ( matches_single. opts_str( & [ "encrypt" . to_string( ) , "e" . to_string( ) ] ) . unwrap( ) ,
1408
- "foo" . to_string ( ) ) ;
1408
+ "foo" ) ;
1409
1409
1410
1410
let args_both = vec ! ( "-e" . to_string( ) , "foo" . to_string( ) , "--encrypt" . to_string( ) ,
1411
1411
"foo" . to_string( ) ) ;
@@ -1422,12 +1422,12 @@ mod tests {
1422
1422
assert ! ( !matches_both. opts_present( & [ "thing" . to_string( ) ] ) ) ;
1423
1423
assert ! ( !matches_both. opts_present( & [ ] ) ) ;
1424
1424
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" ) ;
1427
1427
assert_eq ! ( matches_both. opts_str( & [ "e" . to_string( ) , "encrypt" . to_string( ) ] ) . unwrap( ) ,
1428
- "foo" . to_string ( ) ) ;
1428
+ "foo" ) ;
1429
1429
assert_eq ! ( matches_both. opts_str( & [ "encrypt" . to_string( ) , "e" . to_string( ) ] ) . unwrap( ) ,
1430
- "foo" . to_string ( ) ) ;
1430
+ "foo" ) ;
1431
1431
}
1432
1432
1433
1433
#[ test]
@@ -1440,9 +1440,9 @@ mod tests {
1440
1440
result:: Err ( _) => panic ! ( )
1441
1441
} ;
1442
1442
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" ) ;
1444
1444
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( ) , "." ) ;
1446
1446
1447
1447
}
1448
1448
@@ -1456,7 +1456,7 @@ mod tests {
1456
1456
result:: Err ( e) => panic ! ( "{}" , e )
1457
1457
} ;
1458
1458
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" ) ;
1460
1460
assert ! ( matches. opts_present( & [ "v" . to_string( ) ] ) ) ;
1461
1461
assert_eq ! ( 3 , matches. opt_count( "v" ) ) ;
1462
1462
}
@@ -1510,7 +1510,7 @@ Options:
1510
1510
-k --kiwi Desc
1511
1511
-p [VAL] Desc
1512
1512
-l VAL Desc
1513
- " . to_string ( ) ;
1513
+ " ;
1514
1514
1515
1515
let generated_usage = usage ( "Usage: fruits" , optgroups. as_slice ( ) ) ;
1516
1516
@@ -1537,7 +1537,7 @@ Options:
1537
1537
-k --kiwi This is a long description which won't be wrapped..+..
1538
1538
-a --apple This is a long description which _will_ be
1539
1539
wrapped..+..
1540
- " . to_string ( ) ;
1540
+ " ;
1541
1541
1542
1542
let usage = usage ( "Usage: fruits" , optgroups. as_slice ( ) ) ;
1543
1543
@@ -1563,7 +1563,7 @@ Options:
1563
1563
-a --apple This “description” has some characters that could
1564
1564
confuse the line wrapping; an apple costs 0.51€ in
1565
1565
some parts of Europe.
1566
- " . to_string ( ) ;
1566
+ " ;
1567
1567
1568
1568
let usage = usage ( "Usage: fruits" , optgroups. as_slice ( ) ) ;
1569
1569
0 commit comments