@@ -17,7 +17,6 @@ use std::ops::Deref;
1717
1818#[ derive( Debug , Serialize , Deserialize , Clone ) ]
1919struct OverloadRenderCtx {
20- id : Id ,
2120 anchor : AnchorCtx ,
2221 name : String ,
2322 summary : String ,
@@ -69,29 +68,24 @@ impl FunctionCtx {
6968 }
7069 } ) ;
7170
72- let overload_id = IdBuilder :: new ( ctx. ctx )
71+ let overload_id = IdBuilder :: new ( ctx)
7372 . kind ( IdKind :: Function )
7473 . name ( doc_node. get_name ( ) )
7574 . index ( i)
7675 . build ( ) ;
7776
7877 if overloads_count > 1 {
79- ctx. toc . add_entry (
80- 0 ,
81- & format ! ( "Overload {}" , i + 1 ) ,
82- overload_id. as_str ( ) ,
83- ) ;
78+ ctx
79+ . toc
80+ . add_entry ( 0 , & format ! ( "Overload {}" , i + 1 ) , & overload_id) ;
8481 }
8582
8683 functions_content. push ( OverloadRenderCtx {
87- id : overload_id. clone ( ) ,
88- anchor : AnchorCtx {
89- id : overload_id. clone ( ) ,
90- } ,
84+ anchor : AnchorCtx :: new ( overload_id. clone ( ) ) ,
9185 name : doc_node. get_name ( ) . to_string ( ) ,
9286 summary : render_function_summary ( function_def, ctx) ,
9387 deprecated,
94- content : render_single_function ( ctx, doc_node, overload_id. clone ( ) ) ,
88+ content : render_single_function ( ctx, doc_node, overload_id) ,
9589 } ) ;
9690 }
9791
@@ -161,8 +155,7 @@ fn render_single_function(
161155 . enumerate ( )
162156 . map ( |( i, param) | {
163157 let ( name, str_name) = crate :: html:: parameters:: param_name ( param, i) ;
164- let id = IdBuilder :: new ( ctx. ctx )
165- . component ( & overload_id)
158+ let id = IdBuilder :: new_with_parent ( ctx, & overload_id)
166159 . kind ( IdKind :: Parameter )
167160 . name ( & str_name)
168161 . build ( ) ;
@@ -334,8 +327,7 @@ fn render_function_return_type(
334327) -> Option < DocEntryCtx > {
335328 let return_type = def. return_type . as_ref ( ) ?;
336329
337- let id = IdBuilder :: new ( render_ctx. ctx )
338- . component ( overload_id. as_str ( ) )
330+ let id = IdBuilder :: new_with_parent ( render_ctx, & overload_id)
339331 . kind ( IdKind :: Return )
340332 . build ( ) ;
341333
@@ -367,8 +359,7 @@ fn render_function_throws(
367359 overload_id : Id ,
368360 throws_id : usize ,
369361) -> DocEntryCtx {
370- let id = IdBuilder :: new ( render_ctx. ctx )
371- . component ( overload_id. as_str ( ) )
362+ let id = IdBuilder :: new_with_parent ( render_ctx, & overload_id)
372363 . kind ( IdKind :: Throws )
373364 . index ( throws_id)
374365 . build ( ) ;
0 commit comments