File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -733,7 +733,7 @@ impl TraitAliasPart {
733
733
} ,
734
734
} ;
735
735
736
- let implementors = imps
736
+ let mut implementors = imps
737
737
. iter ( )
738
738
. filter_map ( |imp| {
739
739
// If the trait and implementation are in the same crate, then
@@ -755,12 +755,12 @@ impl TraitAliasPart {
755
755
} )
756
756
}
757
757
} )
758
- . collect :: < Vec < _ > > ( ) ;
758
+ . peekable ( ) ;
759
759
760
760
// Only create a js file if we have impls to add to it. If the trait is
761
761
// documented locally though we always create the file to avoid dead
762
762
// links.
763
- if implementors. is_empty ( ) && !cache. paths . contains_key ( & did) {
763
+ if implementors. peek ( ) . is_none ( ) && !cache. paths . contains_key ( & did) {
764
764
continue ;
765
765
}
766
766
@@ -771,11 +771,7 @@ impl TraitAliasPart {
771
771
path. push ( format ! ( "{remote_item_type}.{}.js" , remote_path[ remote_path. len( ) - 1 ] ) ) ;
772
772
773
773
let part = OrderedJson :: array_sorted (
774
- implementors
775
- . iter ( )
776
- . map ( OrderedJson :: serialize)
777
- . collect :: < Result < Vec < _ > , _ > > ( )
778
- . unwrap ( ) ,
774
+ implementors. map ( |implementor| OrderedJson :: serialize ( implementor) . unwrap ( ) ) ,
779
775
) ;
780
776
path_parts. push ( path, OrderedJson :: array_unsorted ( [ crate_name_json, & part] ) ) ;
781
777
}
You can’t perform that action at this time.
0 commit comments