rustdoc: Move fst and snd into util mod
This commit is contained in:
parent
75dbb0f193
commit
4f2ad6b124
3 changed files with 13 additions and 12 deletions
|
@ -118,16 +118,6 @@ fn name_value_str_pair(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fst<T, U>(+pair: (T, U)) -> T {
|
|
||||||
let (t, _) = pair;
|
|
||||||
ret t;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn snd<T, U>(+pair: (T, U)) -> U {
|
|
||||||
let (_, u) = pair;
|
|
||||||
ret u;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_fn_(
|
fn parse_fn_(
|
||||||
items: [@ast::meta_item]
|
items: [@ast::meta_item]
|
||||||
) -> fn_attrs {
|
) -> fn_attrs {
|
||||||
|
@ -140,8 +130,8 @@ fn parse_fn_(
|
||||||
vec::filter_map(items) {|item|
|
vec::filter_map(items) {|item|
|
||||||
option::map(name_value_str_pair(item)) { |pair|
|
option::map(name_value_str_pair(item)) { |pair|
|
||||||
{
|
{
|
||||||
name: fst(pair),
|
name: util::fst(pair),
|
||||||
desc: snd(pair)
|
desc: util::snd(pair)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,3 +16,4 @@ mod fold;
|
||||||
mod attr_pass;
|
mod attr_pass;
|
||||||
mod tystr_pass;
|
mod tystr_pass;
|
||||||
mod astsrv;
|
mod astsrv;
|
||||||
|
mod util;
|
10
src/rustdoc/util.rs
Normal file
10
src/rustdoc/util.rs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
fn fst<T, U>(+pair: (T, U)) -> T {
|
||||||
|
let (t, _) = pair;
|
||||||
|
ret t;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn snd<T, U>(+pair: (T, U)) -> U {
|
||||||
|
let (_, u) = pair;
|
||||||
|
ret u;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue