@@ -678,15 +678,21 @@ impl Context {
678
678
// using a rwarc makes this parallelizable in the future
679
679
local_data:: set ( cache_key, Arc :: new ( cache) ) ;
680
680
681
- self . item ( item) ;
681
+ let mut work = ~[ ( self , item) ] ;
682
+ while work. len ( ) > 0 {
683
+ let ( mut cx, item) = work. pop ( ) ;
684
+ cx. item ( item, |cx, item| {
685
+ work. push ( ( cx. clone ( ) , item) ) ;
686
+ } )
687
+ }
682
688
}
683
689
684
690
/// Non-parellelized version of rendering an item. This will take the input
685
691
/// item, render its contents, and then invoke the specified closure with
686
692
/// all sub-items which need to be rendered.
687
693
///
688
694
/// The rendering driver uses this closure to queue up more work.
689
- fn item ( & mut self , item : clean:: Item ) {
695
+ fn item ( & mut self , item : clean:: Item , f : | & mut Context , clean :: Item | ) {
690
696
fn render ( w : io:: File , cx : & mut Context , it : & clean:: Item ,
691
697
pushname : bool ) {
692
698
info ! ( "Rendering an item to {}" , w. path( ) . display( ) ) ;
@@ -733,7 +739,7 @@ impl Context {
733
739
} ;
734
740
this. sidebar = build_sidebar ( & m) ;
735
741
for item in m. items . move_iter ( ) {
736
- this . item ( item) ;
742
+ f ( this , item) ;
737
743
}
738
744
} )
739
745
}
0 commit comments