File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: fa3368bc71611f071489a3a5183bd572bc6f4022
2
+ refs/heads/master: f4c31bda62dd42d6d7990a2e56821eff12099bf7
Original file line number Diff line number Diff line change @@ -226,14 +226,16 @@ fn write_return(
226
226
) {
227
227
alt doc. ty {
228
228
some ( ty) {
229
- ctxt. w . write_line ( #fmt ( "Returns `%s`" , ty) ) ;
230
- ctxt. w . write_line ( "" ) ;
229
+ ctxt. w . write_str ( #fmt ( "Returns `%s`" , ty) ) ;
231
230
alt doc. desc {
232
231
some ( d) {
233
- ctxt. w . write_line ( d) ;
232
+ ctxt. w . write_line ( #fmt ( " - %s" , d) ) ;
233
+ ctxt. w . write_line ( "" ) ;
234
+ }
235
+ none {
236
+ ctxt. w . write_line ( "" ) ;
234
237
ctxt. w . write_line ( "" ) ;
235
238
}
236
- none { }
237
239
}
238
240
}
239
241
none { }
@@ -269,6 +271,14 @@ fn should_write_blank_line_after_return_description() {
269
271
assert str:: contains ( markdown, "blorp\n \n " ) ;
270
272
}
271
273
274
+ #[ test]
275
+ fn should_write_return_description_on_same_line_as_type ( ) {
276
+ let markdown = test:: render (
277
+ "#[doc(return = \" blorp\" )] fn a() -> int { }"
278
+ ) ;
279
+ assert str:: contains ( markdown, "Returns `int` - blorp" ) ;
280
+ }
281
+
272
282
#[ cfg( test) ]
273
283
mod test {
274
284
fn render ( source : str ) -> str {
You can’t perform that action at this time.
0 commit comments