about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/tests.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-23 20:13:08 +0100
committerGitHub <noreply@github.com>2022-01-23 20:13:08 +0100
commiteea833f5f1d0de940c0759cc365cef7624a732df (patch)
tree94efb537a260c94c6fcd5f45d2583dc8cad8e719 /compiler/rustc_mir_transform/src/coverage/tests.rs
parenta1645e5b57a42831e98b6c160b31f9f185e8b0c2 (diff)
parentbc8cef194b7754e61aecb27bd5fe15fbe6ee026e (diff)
downloadrust-eea833f5f1d0de940c0759cc365cef7624a732df.tar.gz
rust-eea833f5f1d0de940c0759cc365cef7624a732df.zip
Rollup merge of #93234 - mati865:mir-transform-use-itertools, r=jackh726
rustc_mir_itertools: Avoid needless `collect` with itertools

I don't think this should have measurable perf impact (at least not on perf.rlo benchmarks), it's mostly for readability.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/tests.rs')
-rw-r--r--compiler/rustc_mir_transform/src/coverage/tests.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/tests.rs b/compiler/rustc_mir_transform/src/coverage/tests.rs
index b9c79d4cf2d..62ea2538ff0 100644
--- a/compiler/rustc_mir_transform/src/coverage/tests.rs
+++ b/compiler/rustc_mir_transform/src/coverage/tests.rs
@@ -31,6 +31,7 @@ use super::spans;
 
 use coverage_test_macros::let_bcb;
 
+use itertools::Itertools;
 use rustc_data_structures::graph::WithNumNodes;
 use rustc_data_structures::graph::WithSuccessors;
 use rustc_index::vec::{Idx, IndexVec};
@@ -232,11 +233,9 @@ fn print_mir_graphviz(name: &str, mir_body: &Body<'_>) {
                         mir_body
                             .successors(bb)
                             .map(|successor| { format!("    {:?} -> {:?};", bb, successor) })
-                            .collect::<Vec<_>>()
                             .join("\n")
                     )
                 })
-                .collect::<Vec<_>>()
                 .join("\n")
         );
     }
@@ -262,11 +261,9 @@ fn print_coverage_graphviz(
                         basic_coverage_blocks
                             .successors(bcb)
                             .map(|successor| { format!("    {:?} -> {:?};", bcb, successor) })
-                            .collect::<Vec<_>>()
                             .join("\n")
                     )
                 })
-                .collect::<Vec<_>>()
                 .join("\n")
         );
     }