File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -121,16 +121,18 @@ impl Comments {
121121 ref_fn ! ( pub fn contains_tag( & self , tag: & Comment ) -> bool ) ;
122122 ref_fn ! ( pub fn find_inheritdoc_base( & self ) -> Option <& ' _ str >) ;
123123
124- /// Attempt to lookup
124+ /// Attempts to lookup inherited comments and merge them with the current collection.
125125 ///
126- /// Merges two comments collections by inserting [CommentTag] from the second collection
127- /// into the first unless they are present.
126+ /// Looks up comments in `inheritdocs` using the key `{base}.{ident}` where `base` is
127+ /// extracted from an `@inheritdoc` tag. Merges the found comments by inserting
128+ /// [CommentTag] from the inherited collection into the current one unless they are
129+ /// already present.
128130 pub fn merge_inheritdoc (
129131 & self ,
130132 ident : & str ,
131133 inheritdocs : Option < HashMap < String , Self > > ,
132134 ) -> Self {
133- let mut result = Self ( Vec :: from_iter ( self . iter ( ) . cloned ( ) ) ) ;
135+ let mut result = self . clone ( ) ;
134136
135137 if let ( Some ( inheritdocs) , Some ( base) ) = ( inheritdocs, self . find_inheritdoc_base ( ) ) {
136138 let key = format ! ( "{base}.{ident}" ) ;
You can’t perform that action at this time.
0 commit comments