@@ -91,31 +91,6 @@ pub mod test;
91
91
92
92
use clean:: Attributes ;
93
93
94
- type Pass = ( & ' static str , // name
95
- fn ( clean:: Crate ) -> plugins:: PluginResult , // fn
96
- & ' static str ) ; // description
97
-
98
- const PASSES : & ' static [ Pass ] = & [
99
- ( "strip-hidden" , passes:: strip_hidden,
100
- "strips all doc(hidden) items from the output" ) ,
101
- ( "unindent-comments" , passes:: unindent_comments,
102
- "removes excess indentation on comments in order for markdown to like it" ) ,
103
- ( "collapse-docs" , passes:: collapse_docs,
104
- "concatenates all document attributes into one document attribute" ) ,
105
- ( "strip-private" , passes:: strip_private,
106
- "strips all private items from a crate which cannot be seen externally, \
107
- implies strip-priv-imports") ,
108
- ( "strip-priv-imports" , passes:: strip_priv_imports,
109
- "strips all private import statements (`use`, `extern crate`) from a crate" ) ,
110
- ] ;
111
-
112
- const DEFAULT_PASSES : & ' static [ & ' static str ] = & [
113
- "strip-hidden" ,
114
- "strip-private" ,
115
- "collapse-docs" ,
116
- "unindent-comments" ,
117
- ] ;
118
-
119
94
struct Output {
120
95
krate : clean:: Crate ,
121
96
renderinfo : html:: render:: RenderInfo ,
@@ -222,11 +197,11 @@ pub fn main_args(args: &[String]) -> isize {
222
197
223
198
if matches. opt_strs ( "passes" ) == [ "list" ] {
224
199
println ! ( "Available passes for running rustdoc:" ) ;
225
- for & ( name, _, description) in PASSES {
200
+ for & ( name, _, description) in passes :: PASSES {
226
201
println ! ( "{:>20} - {}" , name, description) ;
227
202
}
228
203
println ! ( "\n Default passes for rustdoc:" ) ;
229
- for & name in DEFAULT_PASSES {
204
+ for & name in passes :: DEFAULT_PASSES {
230
205
println ! ( "{:>20}" , name) ;
231
206
}
232
207
return 0 ;
@@ -411,7 +386,7 @@ fn rust_input(cratefile: &str, externs: Externs, matches: &getopts::Matches) ->
411
386
}
412
387
413
388
if default_passes {
414
- for name in DEFAULT_PASSES . iter ( ) . rev ( ) {
389
+ for name in passes :: DEFAULT_PASSES . iter ( ) . rev ( ) {
415
390
passes. insert ( 0 , name. to_string ( ) ) ;
416
391
}
417
392
}
@@ -421,11 +396,11 @@ fn rust_input(cratefile: &str, externs: Externs, matches: &getopts::Matches) ->
421
396
. unwrap_or ( "/tmp/rustdoc/plugins" . to_string ( ) ) ;
422
397
let mut pm = plugins:: PluginManager :: new ( PathBuf :: from ( path) ) ;
423
398
for pass in & passes {
424
- let plugin = match PASSES . iter ( )
425
- . position ( |& ( p, ..) | {
426
- p == * pass
427
- } ) {
428
- Some ( i) => PASSES [ i] . 1 ,
399
+ let plugin = match passes :: PASSES . iter ( )
400
+ . position ( |& ( p, ..) | {
401
+ p == * pass
402
+ } ) {
403
+ Some ( i) => passes :: PASSES [ i] . 1 ,
429
404
None => {
430
405
error ! ( "unknown pass {}, skipping" , * pass) ;
431
406
continue
0 commit comments