diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-03-04 13:06:01 +0100 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-03-18 14:25:54 +0100 |
| commit | cfb4ad4f2abf42ff603d5f9e89f1352cb79a451c (patch) | |
| tree | 19cfc48983d2549969452202de101fd8e3846233 /compiler/rustc_mir/src/transform/coverage/debug.rs | |
| parent | 895a8e71b1a9fc42631f81b071bc855f7fb3e9a4 (diff) | |
| download | rust-cfb4ad4f2abf42ff603d5f9e89f1352cb79a451c.tar.gz rust-cfb4ad4f2abf42ff603d5f9e89f1352cb79a451c.zip | |
Remove unwrap_none/expect_none from compiler/.
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/debug.rs')
| -rw-r--r-- | compiler/rustc_mir/src/transform/coverage/debug.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_mir/src/transform/coverage/debug.rs b/compiler/rustc_mir/src/transform/coverage/debug.rs index 2cd0dc6b1f2..aabfee53acb 100644 --- a/compiler/rustc_mir/src/transform/coverage/debug.rs +++ b/compiler/rustc_mir/src/transform/coverage/debug.rs @@ -285,10 +285,8 @@ impl DebugCounters { ), }; counters - .insert(id, DebugCounter::new(counter_kind.clone(), some_block_label)) - .expect_none( - "attempt to add the same counter_kind to DebugCounters more than once", - ); + .try_insert(id, DebugCounter::new(counter_kind.clone(), some_block_label)) + .expect("attempt to add the same counter_kind to DebugCounters more than once"); } } @@ -479,9 +477,9 @@ impl GraphvizData { counter_kind: &CoverageKind, ) { if let Some(edge_to_counter) = self.some_edge_to_counter.as_mut() { - edge_to_counter.insert((from_bcb, to_bb), counter_kind.clone()).expect_none( - "invalid attempt to insert more than one edge counter for the same edge", - ); + edge_to_counter + .try_insert((from_bcb, to_bb), counter_kind.clone()) + .expect("invalid attempt to insert more than one edge counter for the same edge"); } } |
