@@ -48,23 +48,23 @@ impl PuritySpace {
48
48
}
49
49
50
50
impl fmt:: Show for clean:: Generics {
51
- fn fmt ( g : & clean :: Generics , f : & mut fmt:: Formatter ) -> fmt:: Result {
52
- if g . lifetimes . len ( ) == 0 && g . type_params . len ( ) == 0 { return Ok ( ( ) ) }
51
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
52
+ if self . lifetimes . len ( ) == 0 && self . type_params . len ( ) == 0 { return Ok ( ( ) ) }
53
53
if_ok ! ( f. buf. write( "<" . as_bytes( ) ) ) ;
54
54
55
- for ( i, life) in g . lifetimes . iter ( ) . enumerate ( ) {
55
+ for ( i, life) in self . lifetimes . iter ( ) . enumerate ( ) {
56
56
if i > 0 {
57
57
if_ok ! ( f. buf. write( ", " . as_bytes( ) ) ) ;
58
58
}
59
59
if_ok ! ( write!( f. buf, "{}" , * life) ) ;
60
60
}
61
61
62
- if g . type_params . len ( ) > 0 {
63
- if g . lifetimes . len ( ) > 0 {
62
+ if self . type_params . len ( ) > 0 {
63
+ if self . lifetimes . len ( ) > 0 {
64
64
if_ok ! ( f. buf. write( ", " . as_bytes( ) ) ) ;
65
65
}
66
66
67
- for ( i, tp) in g . type_params . iter ( ) . enumerate ( ) {
67
+ for ( i, tp) in self . type_params . iter ( ) . enumerate ( ) {
68
68
if i > 0 {
69
69
if_ok ! ( f. buf. write( ", " . as_bytes( ) ) )
70
70
}
@@ -87,16 +87,16 @@ impl fmt::Show for clean::Generics {
87
87
}
88
88
89
89
impl fmt:: Show for clean:: Lifetime {
90
- fn fmt ( l : & clean :: Lifetime , f : & mut fmt:: Formatter ) -> fmt:: Result {
90
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
91
91
if_ok ! ( f. buf. write( "'" . as_bytes( ) ) ) ;
92
- if_ok ! ( f. buf. write( l . get_ref( ) . as_bytes( ) ) ) ;
92
+ if_ok ! ( f. buf. write( self . get_ref( ) . as_bytes( ) ) ) ;
93
93
Ok ( ( ) )
94
94
}
95
95
}
96
96
97
97
impl fmt:: Show for clean:: TyParamBound {
98
- fn fmt ( bound : & clean :: TyParamBound , f : & mut fmt:: Formatter ) -> fmt:: Result {
99
- match * bound {
98
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
99
+ match * self {
100
100
clean:: RegionBound => {
101
101
f. buf . write ( "'static" . as_bytes ( ) )
102
102
}
@@ -108,11 +108,11 @@ impl fmt::Show for clean::TyParamBound {
108
108
}
109
109
110
110
impl fmt:: Show for clean:: Path {
111
- fn fmt ( path : & clean :: Path , f : & mut fmt:: Formatter ) -> fmt:: Result {
112
- if path . global {
111
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
112
+ if self . global {
113
113
if_ok ! ( f. buf. write( "::" . as_bytes( ) ) )
114
114
}
115
- for ( i, seg) in path . segments . iter ( ) . enumerate ( ) {
115
+ for ( i, seg) in self . segments . iter ( ) . enumerate ( ) {
116
116
if i > 0 {
117
117
if_ok ! ( f. buf. write( "::" . as_bytes( ) ) )
118
118
}
@@ -297,8 +297,8 @@ fn typarams(w: &mut io::Writer,
297
297
}
298
298
299
299
impl fmt:: Show for clean:: Type {
300
- fn fmt( g : & clean :: Type , f : & mut fmt:: Formatter ) -> fmt:: Result {
301
- match * g {
300
+ fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
301
+ match * self {
302
302
clean:: TyParamBinder ( id) | clean:: Generic ( id) => {
303
303
local_data:: get ( cache_key, |cache| {
304
304
let m = cache. unwrap ( ) . get ( ) ;
@@ -405,18 +405,18 @@ impl fmt::Show for clean::Type {
405
405
}
406
406
407
407
impl fmt:: Show for clean:: FnDecl {
408
- fn fmt ( d : & clean :: FnDecl , f : & mut fmt:: Formatter ) -> fmt:: Result {
408
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
409
409
write ! ( f. buf, "({args}){arrow, select, yes{ -> {ret}} other{}}" ,
410
- args = d . inputs,
411
- arrow = match d . output { clean:: Unit => "no" , _ => "yes" } ,
412
- ret = d . output)
410
+ args = self . inputs,
411
+ arrow = match self . output { clean:: Unit => "no" , _ => "yes" } ,
412
+ ret = self . output)
413
413
}
414
414
}
415
415
416
416
impl fmt:: Show for ~[ clean:: Argument ] {
417
- fn fmt ( inputs : & ~ [ clean :: Argument ] , f : & mut fmt:: Formatter ) -> fmt:: Result {
417
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
418
418
let mut args = ~"";
419
- for ( i, input) in inputs . iter ( ) . enumerate ( ) {
419
+ for ( i, input) in self . iter ( ) . enumerate ( ) {
420
420
if i > 0 { args. push_str ( ", " ) ; }
421
421
if input. name . len ( ) > 0 {
422
422
args. push_str ( format ! ( "{}: " , input. name) ) ;
@@ -428,8 +428,8 @@ impl fmt::Show for ~[clean::Argument] {
428
428
}
429
429
430
430
impl < ' a > fmt:: Show for Method < ' a > {
431
- fn fmt ( m : & Method < ' a > , f : & mut fmt:: Formatter ) -> fmt:: Result {
432
- let Method ( selfty, d) = * m ;
431
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
432
+ let Method ( selfty, d) = * self ;
433
433
let mut args = ~"";
434
434
match * selfty {
435
435
clean:: SelfStatic => { } ,
@@ -463,8 +463,8 @@ impl<'a> fmt::Show for Method<'a> {
463
463
}
464
464
465
465
impl fmt:: Show for VisSpace {
466
- fn fmt ( v : & VisSpace , f : & mut fmt:: Formatter ) -> fmt:: Result {
467
- match v . get ( ) {
466
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
467
+ match self . get ( ) {
468
468
Some ( ast:: Public ) => write ! ( f. buf, "pub " ) ,
469
469
Some ( ast:: Private ) => write ! ( f. buf, "priv " ) ,
470
470
Some ( ast:: Inherited ) | None => Ok ( ( ) )
@@ -473,8 +473,8 @@ impl fmt::Show for VisSpace {
473
473
}
474
474
475
475
impl fmt:: Show for PuritySpace {
476
- fn fmt ( p : & PuritySpace , f : & mut fmt:: Formatter ) -> fmt:: Result {
477
- match p . get ( ) {
476
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
477
+ match self . get ( ) {
478
478
ast:: UnsafeFn => write ! ( f. buf, "unsafe " ) ,
479
479
ast:: ExternFn => write ! ( f. buf, "extern " ) ,
480
480
ast:: ImpureFn => Ok ( ( ) )
@@ -483,8 +483,8 @@ impl fmt::Show for PuritySpace {
483
483
}
484
484
485
485
impl fmt:: Show for clean:: ViewPath {
486
- fn fmt ( v : & clean :: ViewPath , f : & mut fmt:: Formatter ) -> fmt:: Result {
487
- match * v {
486
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
487
+ match * self {
488
488
clean:: SimpleImport ( ref name, ref src) => {
489
489
if * name == src. path . segments . last ( ) . unwrap ( ) . name {
490
490
write ! ( f. buf, "use {};" , * src)
@@ -510,14 +510,14 @@ impl fmt::Show for clean::ViewPath {
510
510
}
511
511
512
512
impl fmt:: Show for clean:: ImportSource {
513
- fn fmt ( v : & clean :: ImportSource , f : & mut fmt:: Formatter ) -> fmt:: Result {
514
- match v . did {
513
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
514
+ match self . did {
515
515
// FIXME: shouldn't be restricted to just local imports
516
516
Some ( did) if ast_util:: is_local ( did) => {
517
- resolved_path ( f. buf , did. node , & v . path , true )
517
+ resolved_path ( f. buf , did. node , & self . path , true )
518
518
}
519
519
_ => {
520
- for ( i, seg) in v . path . segments . iter ( ) . enumerate ( ) {
520
+ for ( i, seg) in self . path . segments . iter ( ) . enumerate ( ) {
521
521
if i > 0 {
522
522
if_ok ! ( write!( f. buf, "::" ) )
523
523
}
@@ -530,21 +530,21 @@ impl fmt::Show for clean::ImportSource {
530
530
}
531
531
532
532
impl fmt:: Show for clean:: ViewListIdent {
533
- fn fmt ( v : & clean :: ViewListIdent , f : & mut fmt:: Formatter ) -> fmt:: Result {
534
- match v . source {
533
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
534
+ match self . source {
535
535
// FIXME: shouldn't be limited to just local imports
536
536
Some ( did) if ast_util:: is_local ( did) => {
537
537
let path = clean:: Path {
538
538
global : false ,
539
539
segments : ~[ clean:: PathSegment {
540
- name : v . name . clone ( ) ,
540
+ name : self . name . clone ( ) ,
541
541
lifetimes : ~[ ] ,
542
542
types : ~[ ] ,
543
543
} ]
544
544
} ;
545
545
resolved_path ( f. buf , did. node , & path, false )
546
546
}
547
- _ => write ! ( f. buf, "{}" , v . name) ,
547
+ _ => write ! ( f. buf, "{}" , self . name) ,
548
548
}
549
549
}
550
550
}
0 commit comments