std: remove {all*,any*,count} in favour of iterators
This commit is contained in:
parent
ce4f63dcee
commit
65c7c58c8f
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
use core::prelude::*;
|
use core::prelude::*;
|
||||||
|
|
||||||
|
use core::iterator::IteratorUtil;
|
||||||
use core::cast;
|
use core::cast;
|
||||||
use core::ptr;
|
use core::ptr;
|
||||||
use core::sys;
|
use core::sys;
|
||||||
|
@ -122,25 +123,24 @@ pub fn alli<A:Copy + Owned>(
|
||||||
xs: &[A],
|
xs: &[A],
|
||||||
fn_factory: &fn() -> ~fn(uint, &A) -> bool) -> bool
|
fn_factory: &fn() -> ~fn(uint, &A) -> bool) -> bool
|
||||||
{
|
{
|
||||||
do vec::all(map_slices(xs, || {
|
let mapped = map_slices(xs, || {
|
||||||
let f = fn_factory();
|
let f = fn_factory();
|
||||||
let result: ~fn(uint, &[A]) -> bool = |base, slice| {
|
let result: ~fn(uint, &[A]) -> bool = |base, slice| {
|
||||||
vec::alli(slice, |i, x| {
|
slice.iter().enumerate().all(|(i, x)| f(i + base, x))
|
||||||
f(i + base, x)
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
result
|
result
|
||||||
})) |x| { *x }
|
});
|
||||||
|
mapped.iter().all(|&x| x)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if the function holds for any elements in the vector.
|
/// Returns true if the function holds for any elements in the vector.
|
||||||
pub fn any<A:Copy + Owned>(
|
pub fn any<A:Copy + Owned>(
|
||||||
xs: &[A],
|
xs: &[A],
|
||||||
fn_factory: &fn() -> ~fn(&A) -> bool) -> bool {
|
fn_factory: &fn() -> ~fn(&A) -> bool) -> bool {
|
||||||
do vec::any(map_slices(xs, || {
|
let mapped = map_slices(xs, || {
|
||||||
let f = fn_factory();
|
let f = fn_factory();
|
||||||
let result: ~fn(uint, &[A]) -> bool =
|
let result: ~fn(uint, &[A]) -> bool = |_, slice| slice.iter().any(f);
|
||||||
|_, slice| vec::any(slice, |x| f(x));
|
|
||||||
result
|
result
|
||||||
})) |x| { *x }
|
});
|
||||||
|
mapped.iter().any(|&x| x)
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,7 @@ use middle::trans::type_of;
|
||||||
use middle::ty;
|
use middle::ty;
|
||||||
use util::common::indenter;
|
use util::common::indenter;
|
||||||
|
|
||||||
|
use core::iterator::IteratorUtil;
|
||||||
use core::hashmap::HashMap;
|
use core::hashmap::HashMap;
|
||||||
use core::vec;
|
use core::vec;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
@ -798,7 +799,7 @@ pub fn enter_region<'r>(bcx: block,
|
||||||
pub fn get_options(bcx: block, m: &[@Match], col: uint) -> ~[Opt] {
|
pub fn get_options(bcx: block, m: &[@Match], col: uint) -> ~[Opt] {
|
||||||
let ccx = bcx.ccx();
|
let ccx = bcx.ccx();
|
||||||
fn add_to_set(tcx: ty::ctxt, set: &mut ~[Opt], val: Opt) {
|
fn add_to_set(tcx: ty::ctxt, set: &mut ~[Opt], val: Opt) {
|
||||||
if set.any(|l| opt_eq(tcx, l, &val)) {return;}
|
if set.iter().any(|l| opt_eq(tcx, l, &val)) {return;}
|
||||||
set.push(val);
|
set.push(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -965,7 +966,7 @@ pub fn collect_record_or_struct_fields(bcx: block,
|
||||||
fn extend(idents: &mut ~[ast::ident], field_pats: &[ast::field_pat]) {
|
fn extend(idents: &mut ~[ast::ident], field_pats: &[ast::field_pat]) {
|
||||||
for field_pats.each |field_pat| {
|
for field_pats.each |field_pat| {
|
||||||
let field_ident = field_pat.ident;
|
let field_ident = field_pat.ident;
|
||||||
if !vec::any(*idents, |x| *x == field_ident) {
|
if !idents.iter().any(|x| *x == field_ident) {
|
||||||
idents.push(field_ident);
|
idents.push(field_ident);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -976,11 +977,11 @@ pub fn pats_require_rooting(bcx: block,
|
||||||
m: &[@Match],
|
m: &[@Match],
|
||||||
col: uint)
|
col: uint)
|
||||||
-> bool {
|
-> bool {
|
||||||
vec::any(m, |br| {
|
do m.iter().any |br| {
|
||||||
let pat_id = br.pats[col].id;
|
let pat_id = br.pats[col].id;
|
||||||
let key = root_map_key {id: pat_id, derefs: 0u };
|
let key = root_map_key {id: pat_id, derefs: 0u };
|
||||||
bcx.ccx().maps.root_map.contains_key(&key)
|
bcx.ccx().maps.root_map.contains_key(&key)
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn root_pats_as_necessary(mut bcx: block,
|
pub fn root_pats_as_necessary(mut bcx: block,
|
||||||
|
@ -1005,12 +1006,12 @@ pub fn root_pats_as_necessary(mut bcx: block,
|
||||||
// matches may be wildcards like _ or identifiers).
|
// matches may be wildcards like _ or identifiers).
|
||||||
macro_rules! any_pat (
|
macro_rules! any_pat (
|
||||||
($m:expr, $pattern:pat) => (
|
($m:expr, $pattern:pat) => (
|
||||||
vec::any($m, |br| {
|
do ($m).iter().any |br| {
|
||||||
match br.pats[col].node {
|
match br.pats[col].node {
|
||||||
$pattern => true,
|
$pattern => true,
|
||||||
_ => false
|
_ => false
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1031,7 +1032,7 @@ pub fn any_tup_pat(m: &[@Match], col: uint) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn any_tuple_struct_pat(bcx: block, m: &[@Match], col: uint) -> bool {
|
pub fn any_tuple_struct_pat(bcx: block, m: &[@Match], col: uint) -> bool {
|
||||||
vec::any(m, |br| {
|
do m.iter().any |br| {
|
||||||
let pat = br.pats[col];
|
let pat = br.pats[col];
|
||||||
match pat.node {
|
match pat.node {
|
||||||
ast::pat_enum(_, Some(_)) => {
|
ast::pat_enum(_, Some(_)) => {
|
||||||
|
@ -1043,7 +1044,7 @@ pub fn any_tuple_struct_pat(bcx: block, m: &[@Match], col: uint) -> bool {
|
||||||
}
|
}
|
||||||
_ => false
|
_ => false
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type mk_fail = @fn() -> BasicBlockRef;
|
pub type mk_fail = @fn() -> BasicBlockRef;
|
||||||
|
|
|
@ -32,6 +32,7 @@ use middle::ty::{FnSig};
|
||||||
use middle::typeck;
|
use middle::typeck;
|
||||||
use util::ppaux::{Repr,ty_to_str};
|
use util::ppaux::{Repr,ty_to_str};
|
||||||
|
|
||||||
|
use core::iterator::IteratorUtil;
|
||||||
use core::vec;
|
use core::vec;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use syntax::ast_map;
|
use syntax::ast_map;
|
||||||
|
@ -75,7 +76,7 @@ pub fn monomorphic_fn(ccx: @CrateContext,
|
||||||
let param_uses = type_use::type_uses_for(ccx, fn_id, substs.len());
|
let param_uses = type_use::type_uses_for(ccx, fn_id, substs.len());
|
||||||
let hash_id = make_mono_id(ccx, fn_id, substs, vtables, impl_did_opt,
|
let hash_id = make_mono_id(ccx, fn_id, substs, vtables, impl_did_opt,
|
||||||
Some(param_uses));
|
Some(param_uses));
|
||||||
if vec::any(hash_id.params,
|
if hash_id.params.iter().any(
|
||||||
|p| match *p { mono_precise(_, _) => false, _ => true }) {
|
|p| match *p { mono_precise(_, _) => false, _ => true }) {
|
||||||
must_cast = true;
|
must_cast = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ use util::ppaux::{Repr, UserString};
|
||||||
use util::common::{indenter};
|
use util::common::{indenter};
|
||||||
use util::enum_set::{EnumSet, CLike};
|
use util::enum_set::{EnumSet, CLike};
|
||||||
|
|
||||||
|
use core::iterator::IteratorUtil;
|
||||||
use core::cast;
|
use core::cast;
|
||||||
use core::cmp;
|
use core::cmp;
|
||||||
use core::hashmap::{HashMap, HashSet};
|
use core::hashmap::{HashMap, HashSet};
|
||||||
|
@ -2355,8 +2356,8 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
|
||||||
|
|
||||||
ty_struct(did, ref substs) => {
|
ty_struct(did, ref substs) => {
|
||||||
seen.push(did);
|
seen.push(did);
|
||||||
let r = vec::any(struct_fields(cx, did, substs),
|
let fields = struct_fields(cx, did, substs);
|
||||||
|f| type_requires(cx, seen, r_ty, f.mt.ty));
|
let r = fields.iter().any(|f| type_requires(cx, seen, r_ty, f.mt.ty));
|
||||||
seen.pop();
|
seen.pop();
|
||||||
r
|
r
|
||||||
}
|
}
|
||||||
|
@ -2372,12 +2373,12 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
|
||||||
ty_enum(did, ref substs) => {
|
ty_enum(did, ref substs) => {
|
||||||
seen.push(did);
|
seen.push(did);
|
||||||
let vs = enum_variants(cx, did);
|
let vs = enum_variants(cx, did);
|
||||||
let r = vec::len(*vs) > 0u && vec::all(*vs, |variant| {
|
let r = vec::len(*vs) > 0u && do vs.iter().all |variant| {
|
||||||
vec::any(variant.args, |aty| {
|
do variant.args.iter().any |aty| {
|
||||||
let sty = subst(cx, substs, *aty);
|
let sty = subst(cx, substs, *aty);
|
||||||
type_requires(cx, seen, r_ty, sty)
|
type_requires(cx, seen, r_ty, sty)
|
||||||
})
|
}
|
||||||
});
|
};
|
||||||
seen.pop();
|
seen.pop();
|
||||||
r
|
r
|
||||||
}
|
}
|
||||||
|
@ -2519,11 +2520,12 @@ pub fn type_is_pod(cx: ctxt, ty: t) -> bool {
|
||||||
ty_param(_) => result = false,
|
ty_param(_) => result = false,
|
||||||
ty_opaque_closure_ptr(_) => result = true,
|
ty_opaque_closure_ptr(_) => result = true,
|
||||||
ty_struct(did, ref substs) => {
|
ty_struct(did, ref substs) => {
|
||||||
result = vec::all(lookup_struct_fields(cx, did), |f| {
|
let fields = lookup_struct_fields(cx, did);
|
||||||
|
result = do fields.iter().all |f| {
|
||||||
let fty = ty::lookup_item_type(cx, f.id);
|
let fty = ty::lookup_item_type(cx, f.id);
|
||||||
let sty = subst(cx, substs, fty.ty);
|
let sty = subst(cx, substs, fty.ty);
|
||||||
type_is_pod(cx, sty)
|
type_is_pod(cx, sty)
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ty_estr(vstore_slice(*)) | ty_evec(_, vstore_slice(*)) => {
|
ty_estr(vstore_slice(*)) | ty_evec(_, vstore_slice(*)) => {
|
||||||
|
@ -2569,7 +2571,7 @@ pub fn type_is_c_like_enum(cx: ctxt, ty: t) -> bool {
|
||||||
if variants.len() == 0 {
|
if variants.len() == 0 {
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
variants.all(|v| v.args.len() == 0)
|
variants.iter().all(|v| v.args.len() == 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => false
|
_ => false
|
||||||
|
|
|
@ -3065,7 +3065,7 @@ pub fn check_simd(tcx: ty::ctxt, sp: span, id: ast::node_id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let e = ty::lookup_field_type(tcx, did, fields[0].id, substs);
|
let e = ty::lookup_field_type(tcx, did, fields[0].id, substs);
|
||||||
if !vec::all(fields,
|
if !fields.iter().all(
|
||||||
|f| ty::lookup_field_type(tcx, did, f.id, substs) == e) {
|
|f| ty::lookup_field_type(tcx, did, f.id, substs) == e) {
|
||||||
tcx.sess.span_err(sp, "SIMD vector should be homogeneous");
|
tcx.sess.span_err(sp, "SIMD vector should be homogeneous");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -326,7 +326,7 @@ pub trait IteratorUtil<A> {
|
||||||
/// assert!(a.iter().all(|&x| *x > 0));
|
/// assert!(a.iter().all(|&x| *x > 0));
|
||||||
/// assert!(!a.iter().all(|&x| *x > 2));
|
/// assert!(!a.iter().all(|&x| *x > 2));
|
||||||
/// ~~~
|
/// ~~~
|
||||||
fn all(&mut self, f: &fn(&A) -> bool) -> bool;
|
fn all(&mut self, f: &fn(A) -> bool) -> bool;
|
||||||
|
|
||||||
/// Tests whether any element of an iterator satisfies the specified
|
/// Tests whether any element of an iterator satisfies the specified
|
||||||
/// predicate.
|
/// predicate.
|
||||||
|
@ -341,7 +341,7 @@ pub trait IteratorUtil<A> {
|
||||||
/// assert!(it.any(|&x| *x == 3));
|
/// assert!(it.any(|&x| *x == 3));
|
||||||
/// assert!(!it.any(|&x| *x == 3));
|
/// assert!(!it.any(|&x| *x == 3));
|
||||||
/// ~~~
|
/// ~~~
|
||||||
fn any(&mut self, f: &fn(&A) -> bool) -> bool;
|
fn any(&mut self, f: &fn(A) -> bool) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Iterator adaptors provided for every `Iterator` implementation. The adaptor objects are also
|
/// Iterator adaptors provided for every `Iterator` implementation. The adaptor objects are also
|
||||||
|
@ -462,14 +462,14 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
|
||||||
fn count(&mut self) -> uint { self.fold(0, |cnt, _x| cnt + 1) }
|
fn count(&mut self) -> uint { self.fold(0, |cnt, _x| cnt + 1) }
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn all(&mut self, f: &fn(&A) -> bool) -> bool {
|
fn all(&mut self, f: &fn(A) -> bool) -> bool {
|
||||||
for self.advance |x| { if !f(&x) { return false; } }
|
for self.advance |x| { if !f(x) { return false; } }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn any(&mut self, f: &fn(&A) -> bool) -> bool {
|
fn any(&mut self, f: &fn(A) -> bool) -> bool {
|
||||||
for self.advance |x| { if f(&x) { return true; } }
|
for self.advance |x| { if f(x) { return true; } }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1080,18 +1080,18 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_all() {
|
fn test_all() {
|
||||||
let v = ~&[1, 2, 3, 4, 5];
|
let v = ~&[1, 2, 3, 4, 5];
|
||||||
assert!(v.iter().all(|&x| *x < 10));
|
assert!(v.iter().all(|&x| x < 10));
|
||||||
assert!(!v.iter().all(|&x| x.is_even()));
|
assert!(!v.iter().all(|&x| x.is_even()));
|
||||||
assert!(!v.iter().all(|&x| *x > 100));
|
assert!(!v.iter().all(|&x| x > 100));
|
||||||
assert!(v.slice(0, 0).iter().all(|_| fail!()));
|
assert!(v.slice(0, 0).iter().all(|_| fail!()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_any() {
|
fn test_any() {
|
||||||
let v = ~&[1, 2, 3, 4, 5];
|
let v = ~&[1, 2, 3, 4, 5];
|
||||||
assert!(v.iter().any(|&x| *x < 10));
|
assert!(v.iter().any(|&x| x < 10));
|
||||||
assert!(v.iter().any(|&x| x.is_even()));
|
assert!(v.iter().any(|&x| x.is_even()));
|
||||||
assert!(!v.iter().any(|&x| *x > 100));
|
assert!(!v.iter().any(|&x| x > 100));
|
||||||
assert!(!v.slice(0, 0).iter().any(|_| fail!()));
|
assert!(!v.slice(0, 0).iter().any(|_| fail!()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2883,6 +2883,7 @@ impl<'self> Iterator<char> for StrCharIterator<'self> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use iterator::IteratorUtil;
|
||||||
use container::Container;
|
use container::Container;
|
||||||
use char;
|
use char;
|
||||||
use option::Some;
|
use option::Some;
|
||||||
|
@ -2977,7 +2978,7 @@ mod tests {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split_char(s, c) |s| { v.push(s.to_owned()) }
|
for each_split_char(s, c) |s| { v.push(s.to_owned()) }
|
||||||
debug!("split_byte to: %?", v);
|
debug!("split_byte to: %?", v);
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
t("abc.hello.there", '.', [~"abc", ~"hello", ~"there"]);
|
t("abc.hello.there", '.', [~"abc", ~"hello", ~"there"]);
|
||||||
t(".hello.there", '.', [~"", ~"hello", ~"there"]);
|
t(".hello.there", '.', [~"", ~"hello", ~"there"]);
|
||||||
|
@ -2995,7 +2996,7 @@ mod tests {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split_char(s, c) |s| { v.push(s.to_owned()) }
|
for each_split_char(s, c) |s| { v.push(s.to_owned()) }
|
||||||
debug!("split_byte to: %?", v);
|
debug!("split_byte to: %?", v);
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
let data = "ประเทศไทย中华Việt Nam";
|
let data = "ประเทศไทย中华Việt Nam";
|
||||||
t(data, 'V', [~"ประเทศไทย中华", ~"iệt Nam"]);
|
t(data, 'V', [~"ประเทศไทย中华", ~"iệt Nam"]);
|
||||||
|
@ -3010,7 +3011,7 @@ mod tests {
|
||||||
for each_splitn_char(s, c, n) |s| { v.push(s.to_owned()) }
|
for each_splitn_char(s, c, n) |s| { v.push(s.to_owned()) }
|
||||||
debug!("split_byte to: %?", v);
|
debug!("split_byte to: %?", v);
|
||||||
debug!("comparing vs. %?", u);
|
debug!("comparing vs. %?", u);
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
t("abc.hello.there", '.', 0u, [~"abc.hello.there"]);
|
t("abc.hello.there", '.', 0u, [~"abc.hello.there"]);
|
||||||
t("abc.hello.there", '.', 1u, [~"abc", ~"hello.there"]);
|
t("abc.hello.there", '.', 1u, [~"abc", ~"hello.there"]);
|
||||||
|
@ -3037,7 +3038,7 @@ mod tests {
|
||||||
for each_splitn_char(s, c, n) |s| { v.push(s.to_owned()) }
|
for each_splitn_char(s, c, n) |s| { v.push(s.to_owned()) }
|
||||||
debug!("split_byte to: %?", v);
|
debug!("split_byte to: %?", v);
|
||||||
debug!("comparing vs. %?", u);
|
debug!("comparing vs. %?", u);
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
|
|
||||||
t("ประเทศไทย中华Việt Nam", '华', 1u, [~"ประเทศไทย中", ~"Việt Nam"]);
|
t("ประเทศไทย中华Việt Nam", '华', 1u, [~"ประเทศไทย中", ~"Việt Nam"]);
|
||||||
|
@ -3055,7 +3056,7 @@ mod tests {
|
||||||
for each_splitn_char(s, c, n) |s| { v.push(s.to_owned()) }
|
for each_splitn_char(s, c, n) |s| { v.push(s.to_owned()) }
|
||||||
debug!("split_byte to: %?", v);
|
debug!("split_byte to: %?", v);
|
||||||
debug!("comparing vs. %?", u);
|
debug!("comparing vs. %?", u);
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
let data = "ประเทศไทย中华Việt Nam";
|
let data = "ประเทศไทย中华Việt Nam";
|
||||||
t(data, 'V', 1u, [~"ประเทศไทย中华", ~"iệt Nam"]);
|
t(data, 'V', 1u, [~"ประเทศไทย中华", ~"iệt Nam"]);
|
||||||
|
@ -3069,7 +3070,7 @@ mod tests {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split_char_no_trailing(s, c) |s| { v.push(s.to_owned()) }
|
for each_split_char_no_trailing(s, c) |s| { v.push(s.to_owned()) }
|
||||||
debug!("split_byte to: %?", v);
|
debug!("split_byte to: %?", v);
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
t("abc.hello.there", '.', [~"abc", ~"hello", ~"there"]);
|
t("abc.hello.there", '.', [~"abc", ~"hello", ~"there"]);
|
||||||
t(".hello.there", '.', [~"", ~"hello", ~"there"]);
|
t(".hello.there", '.', [~"", ~"hello", ~"there"]);
|
||||||
|
@ -3088,7 +3089,7 @@ mod tests {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split_char_no_trailing(s, c) |s| { v.push(s.to_owned()) }
|
for each_split_char_no_trailing(s, c) |s| { v.push(s.to_owned()) }
|
||||||
debug!("split_byte to: %?", v);
|
debug!("split_byte to: %?", v);
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
let data = "ประเทศไทย中华Việt Nam";
|
let data = "ประเทศไทย中华Việt Nam";
|
||||||
t(data, 'V', [~"ประเทศไทย中华", ~"iệt Nam"]);
|
t(data, 'V', [~"ประเทศไทย中华", ~"iệt Nam"]);
|
||||||
|
@ -3100,7 +3101,7 @@ mod tests {
|
||||||
fn t<'a>(s: &str, sep: &'a str, u: &[~str]) {
|
fn t<'a>(s: &str, sep: &'a str, u: &[~str]) {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split_str(s, sep) |s| { v.push(s.to_owned()) }
|
for each_split_str(s, sep) |s| { v.push(s.to_owned()) }
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
t("--1233345--", "12345", [~"--1233345--"]);
|
t("--1233345--", "12345", [~"--1233345--"]);
|
||||||
t("abc::hello::there", "::", [~"abc", ~"hello", ~"there"]);
|
t("abc::hello::there", "::", [~"abc", ~"hello", ~"there"]);
|
||||||
|
@ -3124,7 +3125,7 @@ mod tests {
|
||||||
fn t(s: &str, sepf: &fn(char) -> bool, u: &[~str]) {
|
fn t(s: &str, sepf: &fn(char) -> bool, u: &[~str]) {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split(s, sepf) |s| { v.push(s.to_owned()) }
|
for each_split(s, sepf) |s| { v.push(s.to_owned()) }
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
|
|
||||||
t("ประเทศไทย中华Việt Nam", |cc| cc == '华', [~"ประเทศไทย中", ~"Việt Nam"]);
|
t("ประเทศไทย中华Việt Nam", |cc| cc == '华', [~"ประเทศไทย中", ~"Việt Nam"]);
|
||||||
|
@ -3140,7 +3141,7 @@ mod tests {
|
||||||
fn t(s: &str, sepf: &fn(char) -> bool, u: &[~str]) {
|
fn t(s: &str, sepf: &fn(char) -> bool, u: &[~str]) {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split_no_trailing(s, sepf) |s| { v.push(s.to_owned()) }
|
for each_split_no_trailing(s, sepf) |s| { v.push(s.to_owned()) }
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
|
|
||||||
t("ประเทศไทย中华Việt Nam", |cc| cc == '华', [~"ประเทศไทย中", ~"Việt Nam"]);
|
t("ประเทศไทย中华Việt Nam", |cc| cc == '华', [~"ประเทศไทย中", ~"Việt Nam"]);
|
||||||
|
@ -3159,7 +3160,7 @@ mod tests {
|
||||||
fn t(s: &str, f: &fn(&str, &fn(&str) -> bool) -> bool, u: &[~str]) {
|
fn t(s: &str, f: &fn(&str, &fn(&str) -> bool) -> bool, u: &[~str]) {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for f(s) |s| { v.push(s.to_owned()) }
|
for f(s) |s| { v.push(s.to_owned()) }
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
|
|
||||||
t(lf, each_line, [~"", ~"Mary had a little lamb", ~"Little lamb"]);
|
t(lf, each_line, [~"", ~"Mary had a little lamb", ~"Little lamb"]);
|
||||||
|
@ -3179,7 +3180,7 @@ mod tests {
|
||||||
fn t(s: &str, f: &fn(&str, &fn(&str) -> bool) -> bool, u: &[~str]) {
|
fn t(s: &str, f: &fn(&str, &fn(&str) -> bool) -> bool, u: &[~str]) {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for f(s) |s| { v.push(s.to_owned()) }
|
for f(s) |s| { v.push(s.to_owned()) }
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
let data = "\nMary had a little lamb\nLittle lamb\n";
|
let data = "\nMary had a little lamb\nLittle lamb\n";
|
||||||
|
|
||||||
|
@ -3193,7 +3194,7 @@ mod tests {
|
||||||
fn t(s: &str, i: uint, u: &[~str]) {
|
fn t(s: &str, i: uint, u: &[~str]) {
|
||||||
let mut v = ~[];
|
let mut v = ~[];
|
||||||
for each_split_within(s, i) |s| { v.push(s.to_owned()) }
|
for each_split_within(s, i) |s| { v.push(s.to_owned()) }
|
||||||
assert!(vec::all2(v, u, |a,b| a == b));
|
assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
|
||||||
}
|
}
|
||||||
t("", 0, []);
|
t("", 0, []);
|
||||||
t("", 15, []);
|
t("", 15, []);
|
||||||
|
|
|
@ -1124,80 +1124,12 @@ pub fn foldr<'a, T, U>(v: &'a [T], mut z: U, p: &fn(t: &'a T, u: U) -> U) -> U {
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if a predicate matches any elements
|
|
||||||
*
|
|
||||||
* If the vector contains no elements then false is returned.
|
|
||||||
*/
|
|
||||||
pub fn any<T>(v: &[T], f: &fn(t: &T) -> bool) -> bool {
|
|
||||||
for each(v) |elem| { if f(elem) { return true; } }
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if a predicate matches any elements in both vectors.
|
|
||||||
*
|
|
||||||
* If the vectors contains no elements then false is returned.
|
|
||||||
*/
|
|
||||||
pub fn any2<T, U>(v0: &[T], v1: &[U],
|
|
||||||
f: &fn(a: &T, b: &U) -> bool) -> bool {
|
|
||||||
let v0_len = len(v0);
|
|
||||||
let v1_len = len(v1);
|
|
||||||
let mut i = 0u;
|
|
||||||
while i < v0_len && i < v1_len {
|
|
||||||
if f(&v0[i], &v1[i]) { return true; };
|
|
||||||
i += 1u;
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if a predicate matches all elements
|
|
||||||
*
|
|
||||||
* If the vector contains no elements then true is returned.
|
|
||||||
*/
|
|
||||||
pub fn all<T>(v: &[T], f: &fn(t: &T) -> bool) -> bool {
|
|
||||||
for each(v) |elem| { if !f(elem) { return false; } }
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if a predicate matches all elements
|
|
||||||
*
|
|
||||||
* If the vector contains no elements then true is returned.
|
|
||||||
*/
|
|
||||||
pub fn alli<T>(v: &[T], f: &fn(uint, t: &T) -> bool) -> bool {
|
|
||||||
for eachi(v) |i, elem| { if !f(i, elem) { return false; } }
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if a predicate matches all elements in both vectors.
|
|
||||||
*
|
|
||||||
* If the vectors are not the same size then false is returned.
|
|
||||||
*/
|
|
||||||
pub fn all2<T, U>(v0: &[T], v1: &[U],
|
|
||||||
f: &fn(t: &T, u: &U) -> bool) -> bool {
|
|
||||||
let v0_len = len(v0);
|
|
||||||
if v0_len != len(v1) { return false; }
|
|
||||||
let mut i = 0u;
|
|
||||||
while i < v0_len { if !f(&v0[i], &v1[i]) { return false; }; i += 1u; }
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Return true if a vector contains an element with the given value
|
/// Return true if a vector contains an element with the given value
|
||||||
pub fn contains<T:Eq>(v: &[T], x: &T) -> bool {
|
pub fn contains<T:Eq>(v: &[T], x: &T) -> bool {
|
||||||
for each(v) |elt| { if *x == *elt { return true; } }
|
for each(v) |elt| { if *x == *elt { return true; } }
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the number of elements that are equal to a given value
|
|
||||||
pub fn count<T:Eq>(v: &[T], x: &T) -> uint {
|
|
||||||
let mut cnt = 0u;
|
|
||||||
for each(v) |elt| { if *x == *elt { cnt += 1u; } }
|
|
||||||
cnt
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for the first element that matches a given predicate
|
* Search for the first element that matches a given predicate
|
||||||
*
|
*
|
||||||
|
@ -2074,7 +2006,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
|
||||||
* If the vector is empty, true is returned.
|
* If the vector is empty, true is returned.
|
||||||
*/
|
*/
|
||||||
fn alli(&self, f: &fn(uint, t: &T) -> bool) -> bool {
|
fn alli(&self, f: &fn(uint, t: &T) -> bool) -> bool {
|
||||||
alli(*self, f)
|
self.iter().enumerate().all(|(i, t)| f(i,t))
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Apply a function to each element of a vector and return a concatenation
|
* Apply a function to each element of a vector and return a concatenation
|
||||||
|
@ -3558,33 +3490,6 @@ mod tests {
|
||||||
~[~[5,2,0],~[5,0,2],~[2,5,0],~[2,0,5],~[0,5,2],~[0,2,5]]);
|
~[~[5,2,0],~[5,0,2],~[2,5,0],~[2,0,5],~[0,5,2],~[0,2,5]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_any_and_all() {
|
|
||||||
assert!(any([1u, 2u, 3u], is_three));
|
|
||||||
assert!(!any([0u, 1u, 2u], is_three));
|
|
||||||
assert!(any([1u, 2u, 3u, 4u, 5u], is_three));
|
|
||||||
assert!(!any([1u, 2u, 4u, 5u, 6u], is_three));
|
|
||||||
|
|
||||||
assert!(all([3u, 3u, 3u], is_three));
|
|
||||||
assert!(!all([3u, 3u, 2u], is_three));
|
|
||||||
assert!(all([3u, 3u, 3u, 3u, 3u], is_three));
|
|
||||||
assert!(!all([3u, 3u, 0u, 1u, 2u], is_three));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_any2_and_all2() {
|
|
||||||
|
|
||||||
assert!(any2([2u, 4u, 6u], [2u, 4u, 6u], is_equal));
|
|
||||||
assert!(any2([1u, 2u, 3u], [4u, 5u, 3u], is_equal));
|
|
||||||
assert!(!any2([1u, 2u, 3u], [4u, 5u, 6u], is_equal));
|
|
||||||
assert!(any2([2u, 4u, 6u], [2u, 4u], is_equal));
|
|
||||||
|
|
||||||
assert!(all2([2u, 4u, 6u], [2u, 4u, 6u], is_equal));
|
|
||||||
assert!(!all2([1u, 2u, 3u], [4u, 5u, 3u], is_equal));
|
|
||||||
assert!(!all2([1u, 2u, 3u], [4u, 5u, 6u], is_equal));
|
|
||||||
assert!(!all2([2u, 4u, 6u], [2u, 4u], is_equal));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_zip_unzip() {
|
fn test_zip_unzip() {
|
||||||
let v1 = ~[1, 2, 3];
|
let v1 = ~[1, 2, 3];
|
||||||
|
@ -4361,81 +4266,6 @@ mod tests {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore(windows)]
|
|
||||||
#[should_fail]
|
|
||||||
fn test_any_fail() {
|
|
||||||
let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)];
|
|
||||||
let mut i = 0;
|
|
||||||
do any(v) |_elt| {
|
|
||||||
if i == 2 {
|
|
||||||
fail!()
|
|
||||||
}
|
|
||||||
i += 0;
|
|
||||||
false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore(windows)]
|
|
||||||
#[should_fail]
|
|
||||||
fn test_any2_fail() {
|
|
||||||
let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)];
|
|
||||||
let mut i = 0;
|
|
||||||
do any(v) |_elt| {
|
|
||||||
if i == 2 {
|
|
||||||
fail!()
|
|
||||||
}
|
|
||||||
i += 0;
|
|
||||||
false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore(windows)]
|
|
||||||
#[should_fail]
|
|
||||||
fn test_all_fail() {
|
|
||||||
let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)];
|
|
||||||
let mut i = 0;
|
|
||||||
do all(v) |_elt| {
|
|
||||||
if i == 2 {
|
|
||||||
fail!()
|
|
||||||
}
|
|
||||||
i += 0;
|
|
||||||
true
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore(windows)]
|
|
||||||
#[should_fail]
|
|
||||||
fn test_alli_fail() {
|
|
||||||
let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)];
|
|
||||||
let mut i = 0;
|
|
||||||
do alli(v) |_i, _elt| {
|
|
||||||
if i == 2 {
|
|
||||||
fail!()
|
|
||||||
}
|
|
||||||
i += 0;
|
|
||||||
true
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore(windows)]
|
|
||||||
#[should_fail]
|
|
||||||
fn test_all2_fail() {
|
|
||||||
let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)];
|
|
||||||
let mut i = 0;
|
|
||||||
do all2(v, v) |_elt1, _elt2| {
|
|
||||||
if i == 2 {
|
|
||||||
fail!()
|
|
||||||
}
|
|
||||||
i += 0;
|
|
||||||
true
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore(windows)]
|
#[ignore(windows)]
|
||||||
#[should_fail]
|
#[should_fail]
|
||||||
|
@ -4617,7 +4447,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_mut_rev_iterator() {
|
fn test_mut_rev_iterator() {
|
||||||
use iterator::*;
|
use iterator::*;
|
||||||
let mut xs = [1, 2, 3, 4, 5];
|
let mut xs = [1u, 2, 3, 4, 5];
|
||||||
for xs.mut_rev_iter().enumerate().advance |(i,x)| {
|
for xs.mut_rev_iter().enumerate().advance |(i,x)| {
|
||||||
*x += i;
|
*x += i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ use extra::arc;
|
||||||
use extra::time;
|
use extra::time;
|
||||||
use extra::deque::Deque;
|
use extra::deque::Deque;
|
||||||
use extra::par;
|
use extra::par;
|
||||||
|
use std::iterator::IteratorUtil;
|
||||||
use std::hashmap::HashSet;
|
use std::hashmap::HashSet;
|
||||||
use std::int::abs;
|
use std::int::abs;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
@ -111,7 +112,7 @@ fn gen_search_keys(graph: &[~[node_id]], n: uint) -> ~[node_id] {
|
||||||
while keys.len() < n {
|
while keys.len() < n {
|
||||||
let k = r.gen_uint_range(0u, graph.len());
|
let k = r.gen_uint_range(0u, graph.len());
|
||||||
|
|
||||||
if graph[k].len() > 0u && vec::any(graph[k], |i| {
|
if graph[k].len() > 0u && graph[k].iter().any(|i| {
|
||||||
*i != k as node_id
|
*i != k as node_id
|
||||||
}) {
|
}) {
|
||||||
keys.insert(k as node_id);
|
keys.insert(k as node_id);
|
||||||
|
@ -187,7 +188,7 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
while vec::any(colors, is_gray) {
|
while colors.iter().any(is_gray) {
|
||||||
// Do the BFS.
|
// Do the BFS.
|
||||||
info!("PBFS iteration %?", i);
|
info!("PBFS iteration %?", i);
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
use std::iterator::IteratorUtil;
|
||||||
use std::vec;
|
use std::vec;
|
||||||
|
|
||||||
// Check usage and precedence of block arguments in expressions:
|
// Check usage and precedence of block arguments in expressions:
|
||||||
|
@ -20,28 +21,28 @@ pub fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Usable at all:
|
// Usable at all:
|
||||||
let mut any_negative = do vec::any(v) |e| { e.is_negative() };
|
let mut any_negative = do v.iter().any |e| { e.is_negative() };
|
||||||
assert!(any_negative);
|
assert!(any_negative);
|
||||||
|
|
||||||
// Higher precedence than assignments:
|
// Higher precedence than assignments:
|
||||||
any_negative = do vec::any(v) |e| { e.is_negative() };
|
any_negative = do v.iter().any |e| { e.is_negative() };
|
||||||
assert!(any_negative);
|
assert!(any_negative);
|
||||||
|
|
||||||
// Higher precedence than unary operations:
|
// Higher precedence than unary operations:
|
||||||
let abs_v = do vec::map(v) |e| { e.abs() };
|
let abs_v = do vec::map(v) |e| { e.abs() };
|
||||||
assert!(do vec::all(abs_v) |e| { e.is_positive() });
|
assert!(do abs_v.iter().all |e| { e.is_positive() });
|
||||||
assert!(!do vec::any(abs_v) |e| { e.is_negative() });
|
assert!(!do abs_v.iter().any |e| { e.is_negative() });
|
||||||
|
|
||||||
// Usable in funny statement-like forms:
|
// Usable in funny statement-like forms:
|
||||||
if !do vec::any(v) |e| { e.is_positive() } {
|
if !do v.iter().any |e| { e.is_positive() } {
|
||||||
assert!(false);
|
assert!(false);
|
||||||
}
|
}
|
||||||
match do vec::all(v) |e| { e.is_negative() } {
|
match do v.iter().all |e| { e.is_negative() } {
|
||||||
true => { fail!("incorrect answer."); }
|
true => { fail!("incorrect answer."); }
|
||||||
false => { }
|
false => { }
|
||||||
}
|
}
|
||||||
match 3 {
|
match 3 {
|
||||||
_ if do vec::any(v) |e| { e.is_negative() } => {
|
_ if do v.iter().any |e| { e.is_negative() } => {
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
fail!("wrong answer.");
|
fail!("wrong answer.");
|
||||||
|
@ -58,7 +59,7 @@ pub fn main() {
|
||||||
|
|
||||||
// In the tail of a block
|
// In the tail of a block
|
||||||
let w =
|
let w =
|
||||||
if true { do vec::any(abs_v) |e| { e.is_positive() } }
|
if true { do abs_v.iter().any |e| { e.is_positive() } }
|
||||||
else { false };
|
else { false };
|
||||||
assert!(w);
|
assert!(w);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
// xfail-fast
|
// xfail-fast
|
||||||
|
|
||||||
|
use std::iterator::IteratorUtil;
|
||||||
use std::cmp::Eq;
|
use std::cmp::Eq;
|
||||||
use std::vec;
|
use std::vec;
|
||||||
|
|
||||||
|
@ -54,7 +55,8 @@ fn ret_deep() -> ~str {
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let mut last = 0;
|
let mut last = 0;
|
||||||
for vec::all(~[1, 2, 3, 4, 5, 6, 7]) |e| {
|
let v = ~[1, 2, 3, 4, 5, 6, 7];
|
||||||
|
for v.iter().all |e| {
|
||||||
last = *e;
|
last = *e;
|
||||||
if *e == 5 { break; }
|
if *e == 5 { break; }
|
||||||
if *e % 2 == 1 { loop; }
|
if *e % 2 == 1 { loop; }
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
extern mod extra;
|
extern mod extra;
|
||||||
|
|
||||||
use std::vec;
|
use std::iterator::IteratorUtil;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore(cfg(ignorecfg))]
|
#[ignore(cfg(ignorecfg))]
|
||||||
|
@ -30,11 +30,9 @@ fn checktests() {
|
||||||
// Pull the tests out of the secreturn test module
|
// Pull the tests out of the secreturn test module
|
||||||
let tests = __test::tests;
|
let tests = __test::tests;
|
||||||
|
|
||||||
assert!(vec::any(
|
assert!(
|
||||||
tests,
|
tests.iter().any(|t| t.desc.name.to_str() == ~"shouldignore" && t.desc.ignore));
|
||||||
|t| t.desc.name.to_str() == ~"shouldignore" && t.desc.ignore));
|
|
||||||
|
|
||||||
assert!(vec::any(
|
assert!(
|
||||||
tests,
|
tests.iter().any(|t| t.desc.name.to_str() == ~"shouldnotignore" && !t.desc.ignore));
|
||||||
|t| t.desc.name.to_str() == ~"shouldnotignore" && !t.desc.ignore));
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue