10
10
11
11
//! HTML formatting module
12
12
//!
13
- //! This module contains a large number of `fmt::Default ` implementations for
13
+ //! This module contains a large number of `fmt::Show ` implementations for
14
14
//! various types in `rustdoc::clean`. These implementations all currently
15
15
//! assume that HTML output is desired, although it may be possible to redesign
16
16
//! them in the future to instead emit any format desired.
@@ -47,7 +47,7 @@ impl PuritySpace {
47
47
}
48
48
}
49
49
50
- impl fmt:: Default for clean:: Generics {
50
+ impl fmt:: Show for clean:: Generics {
51
51
fn fmt ( g : & clean:: Generics , f : & mut fmt:: Formatter ) {
52
52
if g. lifetimes . len ( ) == 0 && g. type_params . len ( ) == 0 { return }
53
53
f. buf . write ( "<" . as_bytes ( ) ) ;
@@ -77,14 +77,14 @@ impl fmt::Default for clean::Generics {
77
77
}
78
78
}
79
79
80
- impl fmt:: Default for clean:: Lifetime {
80
+ impl fmt:: Show for clean:: Lifetime {
81
81
fn fmt ( l : & clean:: Lifetime , f : & mut fmt:: Formatter ) {
82
82
f. buf . write ( "'" . as_bytes ( ) ) ;
83
83
f. buf . write ( l. get_ref ( ) . as_bytes ( ) ) ;
84
84
}
85
85
}
86
86
87
- impl fmt:: Default for clean:: TyParamBound {
87
+ impl fmt:: Show for clean:: TyParamBound {
88
88
fn fmt ( bound : & clean:: TyParamBound , f : & mut fmt:: Formatter ) {
89
89
match * bound {
90
90
clean:: RegionBound => {
@@ -97,7 +97,7 @@ impl fmt::Default for clean::TyParamBound {
97
97
}
98
98
}
99
99
100
- impl fmt:: Default for clean:: Path {
100
+ impl fmt:: Show for clean:: Path {
101
101
fn fmt ( path : & clean:: Path , f : & mut fmt:: Formatter ) {
102
102
if path. global { f. buf . write ( "::" . as_bytes ( ) ) }
103
103
for ( i, seg) in path. segments . iter ( ) . enumerate ( ) {
@@ -269,7 +269,7 @@ fn typarams(w: &mut io::Writer, typarams: &Option<~[clean::TyParamBound]>) {
269
269
}
270
270
}
271
271
272
- impl fmt:: Default for clean:: Type {
272
+ impl fmt:: Show for clean:: Type {
273
273
fn fmt ( g : & clean:: Type , f : & mut fmt:: Formatter ) {
274
274
match * g {
275
275
clean:: TyParamBinder ( id) | clean:: Generic ( id) => {
@@ -374,7 +374,7 @@ impl fmt::Default for clean::Type {
374
374
}
375
375
}
376
376
377
- impl fmt:: Default for clean:: FnDecl {
377
+ impl fmt:: Show for clean:: FnDecl {
378
378
fn fmt ( d : & clean:: FnDecl , f : & mut fmt:: Formatter ) {
379
379
write ! ( f. buf, "({args}){arrow, select, yes{ -> {ret}} other{}}" ,
380
380
args = d. inputs,
@@ -383,7 +383,7 @@ impl fmt::Default for clean::FnDecl {
383
383
}
384
384
}
385
385
386
- impl fmt:: Default for ~[ clean:: Argument ] {
386
+ impl fmt:: Show for ~[ clean:: Argument ] {
387
387
fn fmt ( inputs : & ~[ clean:: Argument ] , f : & mut fmt:: Formatter ) {
388
388
let mut args = ~"";
389
389
for ( i, input) in inputs. iter ( ) . enumerate ( ) {
@@ -397,7 +397,7 @@ impl fmt::Default for ~[clean::Argument] {
397
397
}
398
398
}
399
399
400
- impl < ' a > fmt:: Default for Method < ' a > {
400
+ impl < ' a > fmt:: Show for Method < ' a > {
401
401
fn fmt ( m : & Method < ' a > , f : & mut fmt:: Formatter ) {
402
402
let Method ( selfty, d) = * m;
403
403
let mut args = ~"";
@@ -433,7 +433,7 @@ impl<'a> fmt::Default for Method<'a> {
433
433
}
434
434
}
435
435
436
- impl fmt:: Default for VisSpace {
436
+ impl fmt:: Show for VisSpace {
437
437
fn fmt ( v : & VisSpace , f : & mut fmt:: Formatter ) {
438
438
match v. get ( ) {
439
439
Some ( ast:: Public ) => { write ! ( f. buf, "pub " ) ; }
@@ -443,7 +443,7 @@ impl fmt::Default for VisSpace {
443
443
}
444
444
}
445
445
446
- impl fmt:: Default for PuritySpace {
446
+ impl fmt:: Show for PuritySpace {
447
447
fn fmt ( p : & PuritySpace , f : & mut fmt:: Formatter ) {
448
448
match p. get ( ) {
449
449
ast:: UnsafeFn => write ! ( f. buf, "unsafe " ) ,
@@ -453,7 +453,7 @@ impl fmt::Default for PuritySpace {
453
453
}
454
454
}
455
455
456
- impl fmt:: Default for clean:: ViewPath {
456
+ impl fmt:: Show for clean:: ViewPath {
457
457
fn fmt ( v : & clean:: ViewPath , f : & mut fmt:: Formatter ) {
458
458
match * v {
459
459
clean:: SimpleImport ( ref name, ref src) => {
@@ -478,7 +478,7 @@ impl fmt::Default for clean::ViewPath {
478
478
}
479
479
}
480
480
481
- impl fmt:: Default for clean:: ImportSource {
481
+ impl fmt:: Show for clean:: ImportSource {
482
482
fn fmt ( v : & clean:: ImportSource , f : & mut fmt:: Formatter ) {
483
483
match v. did {
484
484
// FIXME: shouldn't be restricted to just local imports
@@ -495,7 +495,7 @@ impl fmt::Default for clean::ImportSource {
495
495
}
496
496
}
497
497
498
- impl fmt:: Default for clean:: ViewListIdent {
498
+ impl fmt:: Show for clean:: ViewListIdent {
499
499
fn fmt ( v : & clean:: ViewListIdent , f : & mut fmt:: Formatter ) {
500
500
match v. source {
501
501
// FIXME: shouldn't be limited to just local imports
0 commit comments