rustdoc: Move fst and snd into util mod
This commit is contained in:
parent
75dbb0f193
commit
4f2ad6b124
@ -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_(
|
||||
items: [@ast::meta_item]
|
||||
) -> fn_attrs {
|
||||
@ -140,8 +130,8 @@ fn parse_fn_(
|
||||
vec::filter_map(items) {|item|
|
||||
option::map(name_value_str_pair(item)) { |pair|
|
||||
{
|
||||
name: fst(pair),
|
||||
desc: snd(pair)
|
||||
name: util::fst(pair),
|
||||
desc: util::snd(pair)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,3 +16,4 @@ mod fold;
|
||||
mod attr_pass;
|
||||
mod tystr_pass;
|
||||
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…
x
Reference in New Issue
Block a user