diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-16 19:28:52 -0800 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-16 19:29:38 -0800 |
| commit | 8bde2c1d6533bf693dbb6ae8105bb082ad0ff0fe (patch) | |
| tree | bce3ae28786559070cfb1811b816e7c30648a2f0 /src | |
| parent | a2ec5400ffd083fac935ba43b6d60a6bdccbb1d6 (diff) | |
| download | rust-8bde2c1d6533bf693dbb6ae8105bb082ad0ff0fe.tar.gz rust-8bde2c1d6533bf693dbb6ae8105bb082ad0ff0fe.zip | |
Minor cleanup and eliminate a bad copy
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/front/test.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs index 17de40b9642..0f80d003690 100644 --- a/src/librustc/front/test.rs +++ b/src/librustc/front/test.rs @@ -145,19 +145,17 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) -> } fn is_test_fn(i: @ast::item) -> bool { - let has_test_attr = - vec::len(attr::find_attrs_by_name(i.attrs, ~"test")) > 0u; + let has_test_attr = attr::find_attrs_by_name(i.attrs, + ~"test").is_not_empty(); fn has_test_signature(i: @ast::item) -> bool { - match /*bad*/copy i.node { - ast::item_fn(decl, _, tps, _) => { - let input_cnt = vec::len(decl.inputs); + match &i.node { + &ast::item_fn(ref decl, _, ref tps, _) => { let no_output = match decl.output.node { ast::ty_nil => true, _ => false }; - let tparm_cnt = vec::len(tps); - input_cnt == 0u && no_output && tparm_cnt == 0u + decl.inputs.is_empty() && no_output && tps.is_empty() } _ => false } |
