about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/debug.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-12-13 11:05:36 +0900
committerGitHub <noreply@github.com>2020-12-13 11:05:36 +0900
commit1b81f08d4cc817548f0b503f33c8b665455d60a6 (patch)
tree9bb0dbecafcdd4a2ab298161e946fa4d8e46887d /compiler/rustc_mir/src/transform/coverage/debug.rs
parentf80c6aeb87abdf79e370de012a56245cbb91f6b9 (diff)
parentcf10a0abf23850018b32ed9a15b1bce6a1e71c93 (diff)
downloadrust-1b81f08d4cc817548f0b503f33c8b665455d60a6.tar.gz
rust-1b81f08d4cc817548f0b503f33c8b665455d60a6.zip
Rollup merge of #79940 - matthiaskrgr:cl15ppy, r=Dylan-DPC
fix more clippy::complexity findings

fix clippy::unnecessary_filter_map
use if let Some(x) = ..  instead of ...map(|x|) to conditionally run fns that return () (clippy::option_map_unit_fn)
fix clippy::{needless_bool, manual_unwrap_or}
don't clone types that are copy (clippy::clone_on_copy)
don't convert types into identical types with .into() (clippy::useless_conversion)
use strip_prefix over slicing (clippy::manual_strip)

r? ``@Dylan-DPC``
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/debug.rs')
-rw-r--r--compiler/rustc_mir/src/transform/coverage/debug.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir/src/transform/coverage/debug.rs b/compiler/rustc_mir/src/transform/coverage/debug.rs
index af81d9af0e2..b66e37436a6 100644
--- a/compiler/rustc_mir/src/transform/coverage/debug.rs
+++ b/compiler/rustc_mir/src/transform/coverage/debug.rs
@@ -285,7 +285,7 @@ impl DebugCounters {
                 ),
             };
             counters
-                .insert(id.into(), DebugCounter::new(counter_kind.clone(), some_block_label))
+                .insert(id, DebugCounter::new(counter_kind.clone(), some_block_label))
                 .expect_none(
                     "attempt to add the same counter_kind to DebugCounters more than once",
                 );
@@ -340,7 +340,7 @@ impl DebugCounters {
         if self.some_counters.is_some() && (counter_format.block || !counter_format.id) {
             let counters = self.some_counters.as_ref().unwrap();
             if let Some(DebugCounter { some_block_label: Some(block_label), .. }) =
-                counters.get(&id.into())
+                counters.get(&id)
             {
                 return if counter_format.id {
                     format!("{}#{}", block_label, id.index())