File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
forc-plugins/forc-doc/src/render Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -120,11 +120,29 @@ impl RenderedDocumentation {
120
120
for ( rendered_doc, local_module_map, local_all_docs) in rendered_results? {
121
121
rendered_docs. 0 . push ( rendered_doc) ;
122
122
123
+ // Merge module maps without overwriting existing categories; append and dedup links.
123
124
for ( key, value) in local_module_map {
124
- module_map. entry ( key) . or_default ( ) . extend ( value) ;
125
+ let entry = module_map. entry ( key) . or_default ( ) ;
126
+ for ( block, mut links) in value {
127
+ let list = entry. entry ( block) . or_default ( ) ;
128
+ // Append new links while avoiding duplicates.
129
+ for link in links. drain ( ..) {
130
+ if !list. contains ( & link) {
131
+ list. push ( link) ;
132
+ }
133
+ }
134
+ }
125
135
}
126
136
127
- all_docs. links . extend ( local_all_docs. links ) ;
137
+ // Merge "all docs" links similarly, preserving existing items.
138
+ for ( block, mut links) in local_all_docs. links {
139
+ let list = all_docs. links . entry ( block) . or_default ( ) ;
140
+ for link in links. drain ( ..) {
141
+ if !list. contains ( & link) {
142
+ list. push ( link) ;
143
+ }
144
+ }
145
+ }
128
146
}
129
147
130
148
// ProjectIndex
You can’t perform that action at this time.
0 commit comments