From 9df03068897602d4377a35c0ae3cf2467666a039 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 19 Jan 2012 00:14:41 -0800 Subject: [PATCH] rustdoc: Cleanup --- src/rustdoc/attr_pass.rs | 21 +++------------------ src/rustdoc/fold.rs | 29 +++++------------------------ src/rustdoc/prune_undoc_pass.rs | 14 ++------------ src/rustdoc/tystr_pass.rs | 7 +------ 4 files changed, 11 insertions(+), 60 deletions(-) diff --git a/src/rustdoc/attr_pass.rs b/src/rustdoc/attr_pass.rs index 5fe6e068494..ee3d8abb8f3 100644 --- a/src/rustdoc/attr_pass.rs +++ b/src/rustdoc/attr_pass.rs @@ -20,24 +20,9 @@ fn run( doc: doc::cratedoc ) -> doc::cratedoc { let fold = fold::fold({ - fold_crate: fn~( - f: fold::fold, - d: doc::cratedoc - ) -> doc::cratedoc { - fold_crate(f, d) - }, - fold_mod: fn~( - f: fold::fold, - d: doc::moddoc - ) -> doc::moddoc { - fold_mod(f, d) - }, - fold_fn: fn~( - f: fold::fold, - d: doc::fndoc - ) -> doc::fndoc { - fold_fn(f, d) - } + fold_crate: fold_crate, + fold_mod: fold_mod, + fold_fn: fold_fn with *fold::default_seq_fold(srv) }); fold.fold_crate(fold, doc) diff --git a/src/rustdoc/fold.rs b/src/rustdoc/fold.rs index 7b52881414c..2d4c8c34731 100644 --- a/src/rustdoc/fold.rs +++ b/src/rustdoc/fold.rs @@ -8,30 +8,11 @@ export default_seq_fold_fnlist; tag fold = t; -type fold_crate = fn~( - fold: fold, - doc: doc::cratedoc -) -> doc::cratedoc; - -type fold_mod = fn~( - fold: fold, - doc: doc::moddoc -) -> doc::moddoc; - -type fold_fn = fn~( - fold: fold, - doc: doc::fndoc -) -> doc::fndoc; - -type fold_modlist = fn~( - fold: fold, - list: doc::modlist -) -> doc::modlist; - -type fold_fnlist = fn~( - fold: fold, - list: doc::fnlist -) -> doc::fnlist; +type fold_crate = fn~(fold: fold, doc: doc::cratedoc) -> doc::cratedoc; +type fold_mod = fn~(fold: fold, doc: doc::moddoc) -> doc::moddoc; +type fold_fn = fn~(fold: fold, doc: doc::fndoc) -> doc::fndoc; +type fold_modlist = fn~(fold: fold,list: doc::modlist) -> doc::modlist; +type fold_fnlist = fn~(fold: fold,list: doc::fnlist) -> doc::fnlist; type t = { ctxt: T, diff --git a/src/rustdoc/prune_undoc_pass.rs b/src/rustdoc/prune_undoc_pass.rs index b431ba6eb68..5bc8696b08a 100644 --- a/src/rustdoc/prune_undoc_pass.rs +++ b/src/rustdoc/prune_undoc_pass.rs @@ -18,18 +18,8 @@ fn run( mutable have_docs: true }; let fold = fold::fold({ - fold_fn: fn~( - f: fold::fold, - d: doc::fndoc - ) -> doc::fndoc { - fold_fn(f, d) - }, - fold_fnlist: fn~( - f: fold::fold, - l: doc::fnlist - ) -> doc::fnlist { - fold_fnlist(f, l) - } + fold_fn: fold_fn, + fold_fnlist: fold_fnlist with *fold::default_seq_fold(ctxt) }); fold.fold_crate(fold, doc) diff --git a/src/rustdoc/tystr_pass.rs b/src/rustdoc/tystr_pass.rs index 26b9a5f4f2f..fe3f0aafb10 100644 --- a/src/rustdoc/tystr_pass.rs +++ b/src/rustdoc/tystr_pass.rs @@ -16,12 +16,7 @@ fn run( doc: doc::cratedoc ) -> doc::cratedoc { let fold = fold::fold({ - fold_fn: fn~( - f: fold::fold, - d: doc::fndoc - ) -> doc::fndoc { - fold_fn(f, d) - } + fold_fn: fold_fn with *fold::default_seq_fold(srv) }); fold.fold_crate(fold, doc)