File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ fn write_mod_contents(
133
133
for itemtag in doc. items {
134
134
alt itemtag {
135
135
doc : : modtag ( moddoc) { write_mod ( ctxt, moddoc) }
136
- doc:: nmodtag ( _ ) { fail }
136
+ doc:: nmodtag ( nmoddoc ) { write_nmod ( ctxt , nmoddoc ) }
137
137
doc:: fntag ( fndoc) { write_fn ( ctxt, fndoc) }
138
138
doc:: consttag ( constdoc) { write_const ( ctxt, constdoc) }
139
139
doc:: enumtag ( enumdoc) { write_enum ( ctxt, enumdoc) }
@@ -157,6 +157,27 @@ fn should_write_crate_description() {
157
157
assert str:: contains ( markdown, "this is the crate" ) ;
158
158
}
159
159
160
+ fn write_nmod ( ctxt : ctxt , doc : doc:: nmoddoc ) {
161
+ write_brief ( ctxt, doc. brief ( ) ) ;
162
+ write_desc ( ctxt, doc. desc ( ) ) ;
163
+
164
+ for fndoc in doc. fns {
165
+ write_fn ( ctxt, fndoc) ;
166
+ }
167
+ }
168
+
169
+ #[ test]
170
+ fn should_write_native_mods ( ) {
171
+ let markdown = test:: render ( "#[doc = \" test\" ] native mod a { }" ) ;
172
+ assert str:: contains ( markdown, "test" ) ;
173
+ }
174
+
175
+ #[ test]
176
+ fn should_write_native_fns ( ) {
177
+ let markdown = test:: render ( "native mod a { #[doc = \" test\" ] fn a(); }" ) ;
178
+ assert str:: contains ( markdown, "test" ) ;
179
+ }
180
+
160
181
fn write_fn (
161
182
ctxt : ctxt ,
162
183
doc : doc:: fndoc
You can’t perform that action at this time.
0 commit comments