]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Put fn docs inside fn bodies
authorBrian Anderson <banderson@mozilla.com>
Wed, 18 Jan 2012 22:06:22 +0000 (14:06 -0800)
committerBrian Anderson <banderson@mozilla.com>
Wed, 18 Jan 2012 23:02:43 +0000 (15:02 -0800)
src/rustdoc/attr_parser.rs
src/rustdoc/extract.rs
src/rustdoc/rustdoc.rs

index 5e1e6eaf6540a1253d0fc51c0d176a5e3313874e..2e82d987b264c9f136be81049c91fce1a2227f19 100644 (file)
     desc: str
 };
 
-#[doc =
-  "Given a vec of attributes, extract the meta_items contained in the \
-   doc attribute"]
 fn doc_meta(
     attrs: [ast::attribute]
 ) -> option<@ast::meta_item> {
+
+    #[doc =
+      "Given a vec of attributes, extract the meta_items contained in the \
+       doc attribute"];
+
     let doc_attrs = attr::find_attrs_by_name(attrs, "doc");
     let doc_metas = attr::attr_metas(doc_attrs);
     if vec::is_not_empty(doc_metas) {
index 51acade36cf9997844fa95ba2dbbfeb905da534b..be183e3b0be7a0a49ba9c66df3e93f8866eeabd4 100644 (file)
@@ -4,11 +4,13 @@
 
 export from_srv, extract;
 
-#[doc = "Use the AST service to create a document tree"]
 fn from_srv(
     srv: astsrv::srv,
     default_name: str
 ) -> doc::cratedoc {
+
+    #[doc = "Use the AST service to create a document tree"];
+
     astsrv::exec(srv) {|ctxt|
         extract(ctxt.ast, default_name)
     }
index 988d4176e0eee2eae3abbfa1f4516d56b6e6b234..2abb6b4718bc255cf872939a4584e3cbe742ac4c 100755 (executable)
@@ -5,12 +5,14 @@
 #[doc = "A single operation on the document model"]
 type pass = fn~(srv: astsrv::srv, doc: doc::cratedoc) -> doc::cratedoc;
 
-#[doc = "Run a series of passes over the document"]
 fn run_passes(
     srv: astsrv::srv,
     doc: doc::cratedoc,
     passes: [pass]
 ) -> doc::cratedoc {
+
+    #[doc = "Run a series of passes over the document"];
+
     vec::foldl(doc, passes) {|doc, pass|
         pass(srv, doc)
     }