@@ -48,23 +48,23 @@ impl PuritySpace {
4848}
4949
5050impl 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 ( ( ) ) }
5353 if_ok ! ( f. buf. write( "<" . as_bytes( ) ) ) ;
5454
55- for ( i, life) in g . lifetimes . iter ( ) . enumerate ( ) {
55+ for ( i, life) in self . lifetimes . iter ( ) . enumerate ( ) {
5656 if i > 0 {
5757 if_ok ! ( f. buf. write( ", " . as_bytes( ) ) ) ;
5858 }
5959 if_ok ! ( write!( f. buf, "{}" , * life) ) ;
6060 }
6161
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 {
6464 if_ok ! ( f. buf. write( ", " . as_bytes( ) ) ) ;
6565 }
6666
67- for ( i, tp) in g . type_params . iter ( ) . enumerate ( ) {
67+ for ( i, tp) in self . type_params . iter ( ) . enumerate ( ) {
6868 if i > 0 {
6969 if_ok ! ( f. buf. write( ", " . as_bytes( ) ) )
7070 }
@@ -87,16 +87,16 @@ impl fmt::Show for clean::Generics {
8787}
8888
8989impl 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 {
9191 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( ) ) ) ;
9393 Ok ( ( ) )
9494 }
9595}
9696
9797impl 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 {
100100 clean:: RegionBound => {
101101 f. buf . write ( "'static" . as_bytes ( ) )
102102 }
@@ -108,11 +108,11 @@ impl fmt::Show for clean::TyParamBound {
108108}
109109
110110impl 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 {
113113 if_ok ! ( f. buf. write( "::" . as_bytes( ) ) )
114114 }
115- for ( i, seg) in path . segments . iter ( ) . enumerate ( ) {
115+ for ( i, seg) in self . segments . iter ( ) . enumerate ( ) {
116116 if i > 0 {
117117 if_ok ! ( f. buf. write( "::" . as_bytes( ) ) )
118118 }
@@ -297,8 +297,8 @@ fn typarams(w: &mut io::Writer,
297297}
298298
299299impl 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 {
302302 clean:: TyParamBinder ( id) | clean:: Generic ( id) => {
303303 local_data:: get ( cache_key, |cache| {
304304 let m = cache. unwrap ( ) . get ( ) ;
@@ -405,18 +405,18 @@ impl fmt::Show for clean::Type {
405405}
406406
407407impl 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 {
409409 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)
413413 }
414414}
415415
416416impl 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 {
418418 let mut args = ~"";
419- for ( i, input) in inputs . iter ( ) . enumerate ( ) {
419+ for ( i, input) in self . iter ( ) . enumerate ( ) {
420420 if i > 0 { args. push_str ( ", " ) ; }
421421 if input. name . len ( ) > 0 {
422422 args. push_str ( format ! ( "{}: " , input. name) ) ;
@@ -428,8 +428,8 @@ impl fmt::Show for ~[clean::Argument] {
428428}
429429
430430impl < ' 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 ;
433433 let mut args = ~"";
434434 match * selfty {
435435 clean:: SelfStatic => { } ,
@@ -463,8 +463,8 @@ impl<'a> fmt::Show for Method<'a> {
463463}
464464
465465impl 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 ( ) {
468468 Some ( ast:: Public ) => write ! ( f. buf, "pub " ) ,
469469 Some ( ast:: Private ) => write ! ( f. buf, "priv " ) ,
470470 Some ( ast:: Inherited ) | None => Ok ( ( ) )
@@ -473,8 +473,8 @@ impl fmt::Show for VisSpace {
473473}
474474
475475impl 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 ( ) {
478478 ast:: UnsafeFn => write ! ( f. buf, "unsafe " ) ,
479479 ast:: ExternFn => write ! ( f. buf, "extern " ) ,
480480 ast:: ImpureFn => Ok ( ( ) )
@@ -483,8 +483,8 @@ impl fmt::Show for PuritySpace {
483483}
484484
485485impl 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 {
488488 clean:: SimpleImport ( ref name, ref src) => {
489489 if * name == src. path . segments . last ( ) . unwrap ( ) . name {
490490 write ! ( f. buf, "use {};" , * src)
@@ -510,14 +510,14 @@ impl fmt::Show for clean::ViewPath {
510510}
511511
512512impl 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 {
515515 // FIXME: shouldn't be restricted to just local imports
516516 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 )
518518 }
519519 _ => {
520- for ( i, seg) in v . path . segments . iter ( ) . enumerate ( ) {
520+ for ( i, seg) in self . path . segments . iter ( ) . enumerate ( ) {
521521 if i > 0 {
522522 if_ok ! ( write!( f. buf, "::" ) )
523523 }
@@ -530,21 +530,21 @@ impl fmt::Show for clean::ImportSource {
530530}
531531
532532impl 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 {
535535 // FIXME: shouldn't be limited to just local imports
536536 Some ( did) if ast_util:: is_local ( did) => {
537537 let path = clean:: Path {
538538 global : false ,
539539 segments : ~[ clean:: PathSegment {
540- name : v . name . clone ( ) ,
540+ name : self . name . clone ( ) ,
541541 lifetimes : ~[ ] ,
542542 types : ~[ ] ,
543543 } ]
544544 } ;
545545 resolved_path ( f. buf , did. node , & path, false )
546546 }
547- _ => write ! ( f. buf, "{}" , v . name) ,
547+ _ => write ! ( f. buf, "{}" , self . name) ,
548548 }
549549 }
550550}
0 commit comments