File tree 2 files changed +8
-6
lines changed
compiler/rustc_resolve/src
src/librustdoc/html/render
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -167,12 +167,13 @@ pub fn unindent_doc_fragments(docs: &mut [DocFragment]) {
167
167
///
168
168
/// Note: remove the trailing newline where appropriate
169
169
pub fn add_doc_fragment ( out : & mut String , frag : & DocFragment ) {
170
- let s = frag. doc . as_str ( ) ;
171
- let mut iter = s. lines ( ) ;
172
- if s. is_empty ( ) {
170
+ if frag. doc == kw:: Empty {
173
171
out. push ( '\n' ) ;
174
172
return ;
175
173
}
174
+ let s = frag. doc . as_str ( ) ;
175
+ let mut iter = s. lines ( ) ;
176
+
176
177
while let Some ( line) = iter. next ( ) {
177
178
if line. chars ( ) . any ( |c| !c. is_whitespace ( ) ) {
178
179
assert ! ( line. len( ) >= frag. indent) ;
Original file line number Diff line number Diff line change @@ -1698,9 +1698,10 @@ fn render_impl(
1698
1698
let id = cx. derive_id ( format ! ( "{item_type}.{name}" ) ) ;
1699
1699
let source_id = trait_
1700
1700
. and_then ( |trait_| {
1701
- trait_. items . iter ( ) . find ( |item| {
1702
- item. name . map ( |n| n. as_str ( ) . eq ( name. as_str ( ) ) ) . unwrap_or ( false )
1703
- } )
1701
+ trait_
1702
+ . items
1703
+ . iter ( )
1704
+ . find ( |item| item. name . map ( |n| n == * name) . unwrap_or ( false ) )
1704
1705
} )
1705
1706
. map ( |item| format ! ( "{}.{name}" , item. type_( ) ) ) ;
1706
1707
write ! ( w, "<section id=\" {id}\" class=\" {item_type}{in_trait_class}\" >" ) ;
You can’t perform that action at this time.
0 commit comments