@@ -457,7 +457,7 @@ pub fn opt_default(mm: &Matches, nm: &str, def: &str) -> Option<~str> {
457
457
let vals = opt_vals( mm, nm) ;
458
458
if vals. is_empty ( ) { return None :: < ~str > ; }
459
459
return match vals[ 0 ] { Val ( ref s) => Some :: < ~str > ( ( * s) . clone( ) ) ,
460
- _ => Some :: < ~str > ( str :: to_owned( def ) ) }
460
+ _ => Some :: < ~str > ( def . to_owned( ) ) }
461
461
}
462
462
463
463
#[ deriving( Eq ) ]
@@ -497,10 +497,10 @@ pub mod groups {
497
497
desc: & str, hint: & str) -> OptGroup {
498
498
let len = short_name. len( ) ;
499
499
assert!( len == 1 || len == 0 ) ;
500
- return OptGroup { short_name : str :: to_owned ( short_name ) ,
501
- long_name : str :: to_owned ( long_name ) ,
502
- hint : str :: to_owned ( hint ) ,
503
- desc : str :: to_owned ( desc ) ,
500
+ return OptGroup { short_name : short_name . to_owned ( ) ,
501
+ long_name : long_name . to_owned ( ) ,
502
+ hint : hint . to_owned ( ) ,
503
+ desc : desc . to_owned ( ) ,
504
504
hasarg : Yes ,
505
505
occur : Req } ;
506
506
}
@@ -510,10 +510,10 @@ pub mod groups {
510
510
desc : & str , hint : & str ) -> OptGroup {
511
511
let len = short_name. len ( ) ;
512
512
assert ! ( len == 1 || len == 0 ) ;
513
- return OptGroup { short_name : str :: to_owned ( short_name ) ,
514
- long_name : str :: to_owned ( long_name ) ,
515
- hint : str :: to_owned ( hint ) ,
516
- desc : str :: to_owned ( desc ) ,
513
+ return OptGroup { short_name : short_name . to_owned ( ) ,
514
+ long_name : long_name . to_owned ( ) ,
515
+ hint : hint . to_owned ( ) ,
516
+ desc : desc . to_owned ( ) ,
517
517
hasarg : Yes ,
518
518
occur : Optional } ;
519
519
}
@@ -523,10 +523,10 @@ pub mod groups {
523
523
desc : & str ) -> OptGroup {
524
524
let len = short_name. len ( ) ;
525
525
assert ! ( len == 1 || len == 0 ) ;
526
- return OptGroup { short_name : str :: to_owned ( short_name ) ,
527
- long_name : str :: to_owned ( long_name ) ,
526
+ return OptGroup { short_name : short_name . to_owned ( ) ,
527
+ long_name : long_name . to_owned ( ) ,
528
528
hint: ~"",
529
- desc : str :: to_owned ( desc ) ,
529
+ desc : desc . to_owned ( ) ,
530
530
hasarg : No ,
531
531
occur : Optional } ;
532
532
}
@@ -536,10 +536,10 @@ pub mod groups {
536
536
desc : & str , hint : & str ) -> OptGroup {
537
537
let len = short_name. len ( ) ;
538
538
assert ! ( len == 1 || len == 0 ) ;
539
- return OptGroup { short_name : str :: to_owned ( short_name ) ,
540
- long_name : str :: to_owned ( long_name ) ,
541
- hint : str :: to_owned ( hint ) ,
542
- desc : str :: to_owned ( desc ) ,
539
+ return OptGroup { short_name : short_name . to_owned ( ) ,
540
+ long_name : long_name . to_owned ( ) ,
541
+ hint : hint . to_owned ( ) ,
542
+ desc : desc . to_owned ( ) ,
543
543
hasarg : Maybe ,
544
544
occur : Optional } ;
545
545
}
@@ -552,10 +552,10 @@ pub mod groups {
552
552
desc : & str , hint : & str ) -> OptGroup {
553
553
let len = short_name. len ( ) ;
554
554
assert ! ( len == 1 || len == 0 ) ;
555
- return OptGroup { short_name : str :: to_owned ( short_name ) ,
556
- long_name : str :: to_owned ( long_name ) ,
557
- hint : str :: to_owned ( hint ) ,
558
- desc : str :: to_owned ( desc ) ,
555
+ return OptGroup { short_name : short_name . to_owned ( ) ,
556
+ long_name : long_name . to_owned ( ) ,
557
+ hint : hint . to_owned ( ) ,
558
+ desc : desc . to_owned ( ) ,
559
559
hasarg : Yes ,
560
560
occur : Multi } ;
561
561
}
@@ -678,7 +678,7 @@ pub mod groups {
678
678
row
679
679
} ) ;
680
680
681
- return str :: to_owned ( brief ) +
681
+ return brief . to_owned ( ) +
682
682
"\n \n Options:\n " +
683
683
rows. collect :: < ~[ ~str ] > ( ) . connect ( "\n " ) +
684
684
"\n \n " ;
0 commit comments