File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,16 @@ fn write_header(ctxt: ctxt, title: str) {
25
25
ctxt. w . write_line ( #fmt ( "%s %s" , hashes, title) ) ;
26
26
}
27
27
28
+ fn subsection ( ctxt : ctxt , f : fn & ( ) ) {
29
+ ctxt. depth += 1 u;
30
+ f ( ) ;
31
+ ctxt. depth -= 1 u;
32
+ }
33
+
28
34
fn write_crate (
29
35
ctxt : ctxt ,
30
36
doc : doc:: cratedoc
31
37
) {
32
- ctxt. depth = 1 u;
33
38
write_header ( ctxt, #fmt ( "Crate %s" , doc. topmod . name ) ) ;
34
39
write_top_module ( ctxt, doc. topmod ) ;
35
40
}
@@ -53,19 +58,22 @@ fn write_mod_contents(
53
58
moddoc : doc:: moddoc
54
59
) {
55
60
for fndoc in * moddoc. fns {
56
- write_fn ( ctxt, fndoc) ;
61
+ subsection ( ctxt) { ||
62
+ write_fn ( ctxt, fndoc) ;
63
+ }
57
64
}
58
65
59
66
for moddoc in * moddoc. mods {
60
- write_mod ( ctxt, moddoc) ;
67
+ subsection ( ctxt) { ||
68
+ write_mod ( ctxt, moddoc) ;
69
+ }
61
70
}
62
71
}
63
72
64
73
fn write_fn (
65
74
ctxt : ctxt ,
66
75
doc : doc:: fndoc
67
76
) {
68
- ctxt. depth = 2 u;
69
77
write_header ( ctxt, #fmt ( "Function `%s`" , doc. name ) ) ;
70
78
alt doc. brief {
71
79
some ( brief) {
You can’t perform that action at this time.
0 commit comments