Skip to content

Commit 04294e4

Browse files
committed
rustdoc: Cleanup
1 parent 6e0bcb5 commit 04294e4

File tree

4 files changed

+11
-25
lines changed

4 files changed

+11
-25
lines changed

src/rustdoc/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type fndoc = ~{
1414
id: ast_id,
1515
name: str,
1616
brief: str,
17-
desc: option::t<str>,
17+
desc: option<str>,
1818
return: option<retdoc>,
1919
args: [(str, str)]
2020
};

src/rustdoc/extract.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ fn moddoc_from_mod(
2424
module: ast::_mod,
2525
name: ast::ident,
2626
_attrs: [ast::attribute]
27-
2827
) -> doc::moddoc {
2928
~{
3029
name: name,

src/rustdoc/gen.rs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ fn write_markdown(
1919
write_top_module(ctxt, doc.topmod);
2020
}
2121

22+
fn write_header(ctxt: ctxt, name: str) {
23+
ctxt.w.write_line("# Crate " + name);
24+
}
25+
2226
fn write_top_module(
2327
ctxt: ctxt,
2428
moddoc: doc::moddoc
@@ -48,29 +52,9 @@ fn write_mod_contents(
4852

4953
fn write_fn(
5054
ctxt: ctxt,
51-
fndoc: doc::fndoc
55+
doc: doc::fndoc
5256
) {
53-
write_fndoc(ctxt, fndoc.name, fndoc);
54-
}
55-
56-
#[doc(
57-
brief = "Generate a crate document header.",
58-
args(rd = "Rustdoc context",
59-
name = "Crate name")
60-
)]
61-
fn write_header(ctxt: ctxt, name: str) {
62-
ctxt.w.write_line("# Crate " + name);
63-
}
64-
65-
#[doc(
66-
brief = "Documents a single function.",
67-
args(rd = "Rustdoc context",
68-
ident = "Identifier for this function",
69-
doc = "Function docs extracted from attributes",
70-
_fn = "AST object representing this function")
71-
)]
72-
fn write_fndoc(ctxt: ctxt, ident: str, doc: doc::fndoc) {
73-
ctxt.w.write_line("## Function `" + ident + "`");
57+
ctxt.w.write_line("## Function `" + doc.name + "`");
7458
ctxt.w.write_line(doc.brief);
7559
alt doc.desc {
7660
some(_d) {

src/rustdoc/tystr_pass.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import rustc::syntax::ast;
22

33
export run;
44

5-
fn run(doc: doc::cratedoc, crate: @ast::crate) -> doc::cratedoc {
5+
fn run(
6+
doc: doc::cratedoc,
7+
crate: @ast::crate
8+
) -> doc::cratedoc {
69
let fold = fold::fold({
710
fold_fn: fn~(
811
f: fold::fold<@ast::crate>,

0 commit comments

Comments
 (0)