File tree Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: c17d58d5bacfe5aa36e0662857386d873e0e2f4f
2
+ refs/heads/master: c4d2cc401561b612fdf66705cb4ac415053fdec3
Original file line number Diff line number Diff line change @@ -91,26 +91,54 @@ fn write_fn(
91
91
doc : doc:: fndoc
92
92
) {
93
93
write_header ( ctxt, #fmt ( "Function `%s`" , doc. name ) ) ;
94
- alt doc. brief {
94
+ write_brief ( ctxt, doc. brief ) ;
95
+ write_desc ( ctxt, doc. desc ) ;
96
+ write_args ( ctxt, doc. args ) ;
97
+ write_return ( ctxt, doc. return ) ;
98
+ }
99
+
100
+ fn write_brief (
101
+ ctxt : ctxt ,
102
+ brief : option < str >
103
+ ) {
104
+ alt brief {
95
105
some( brief) {
96
106
ctxt. w . write_line ( brief) ;
97
107
ctxt. w . write_line ( "" ) ;
98
108
}
99
109
none. { }
100
110
}
101
- alt doc. desc {
111
+ }
112
+
113
+ fn write_desc (
114
+ ctxt : ctxt ,
115
+ desc : option < str >
116
+ ) {
117
+ alt desc {
102
118
some( _d) {
103
119
ctxt. w . write_line ( "" ) ;
104
120
ctxt. w . write_line ( _d) ;
105
121
ctxt. w . write_line ( "" ) ;
106
122
}
107
123
none. { }
108
124
}
109
- for ( arg, desc) in doc. args {
125
+ }
126
+
127
+ fn write_args (
128
+ ctxt : ctxt ,
129
+ args : [ ( str , str ) ]
130
+ ) {
131
+ for ( arg, desc) in args {
110
132
ctxt. w . write_str ( "### Argument `" + arg + "`: " ) ;
111
133
ctxt. w . write_str ( desc)
112
134
}
113
- alt doc. return {
135
+ }
136
+
137
+ fn write_return (
138
+ ctxt : ctxt ,
139
+ return : option < doc:: retdoc >
140
+ ) {
141
+ alt return {
114
142
some ( doc) {
115
143
alt doc. ty {
116
144
some ( ty) {
You can’t perform that action at this time.
0 commit comments