diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-02-20 14:08:14 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-02-20 14:08:14 -0500 |
| commit | 68e5bb3f2caa34753edb7f921c0bcf1efd63cf88 (patch) | |
| tree | d895a5d4acf70d2c9ed4104bdaf1631b2daa351f /src/libsyntax/test.rs | |
| parent | 42e155e13bf16b19251903ae51b2571925345771 (diff) | |
| download | rust-68e5bb3f2caa34753edb7f921c0bcf1efd63cf88.tar.gz rust-68e5bb3f2caa34753edb7f921c0bcf1efd63cf88.zip | |
Remove remaining uses of `[]`. This time I tried to use deref coercions where possible.
Diffstat (limited to 'src/libsyntax/test.rs')
| -rw-r--r-- | src/libsyntax/test.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 7b1fc91e45b..5bada41badf 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -73,14 +73,14 @@ pub fn modify_for_testing(sess: &ParseSess, // We generate the test harness when building in the 'test' // configuration, either with the '--test' or '--cfg test' // command line options. - let should_test = attr::contains_name(&krate.config[], "test"); + let should_test = attr::contains_name(&krate.config, "test"); // Check for #[reexport_test_harness_main = "some_name"] which // creates a `use some_name = __test::main;`. This needs to be // unconditional, so that the attribute is still marked as used in // non-test builds. let reexport_test_harness_main = - attr::first_attr_value_str_by_name(&krate.attrs[], + attr::first_attr_value_str_by_name(&krate.attrs, "reexport_test_harness_main"); if should_test { @@ -306,7 +306,7 @@ enum HasTestSignature { fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool { - let has_test_attr = attr::contains_name(&i.attrs[], "test"); + let has_test_attr = attr::contains_name(&i.attrs, "test"); fn has_test_signature(i: &ast::Item) -> HasTestSignature { match &i.node { @@ -342,7 +342,7 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool { } fn is_bench_fn(cx: &TestCtxt, i: &ast::Item) -> bool { - let has_bench_attr = attr::contains_name(&i.attrs[], "bench"); + let has_bench_attr = attr::contains_name(&i.attrs, "bench"); fn has_test_signature(i: &ast::Item) -> bool { match i.node { @@ -562,7 +562,7 @@ fn mk_tests(cx: &TestCtxt) -> P<ast::Item> { } fn is_test_crate(krate: &ast::Crate) -> bool { - match attr::find_crate_name(&krate.attrs[]) { + match attr::find_crate_name(&krate.attrs) { Some(ref s) if "test" == &s[..] => true, _ => false } |
