Use Option::get_or_default
This commit is contained in:
parent
7e3ebe76ee
commit
1cc8c4de6a
2 changed files with 2 additions and 4 deletions
|
@ -25,6 +25,7 @@ Rust MIR: a lowered representation of Rust.
|
|||
#![feature(stmt_expr_attributes)]
|
||||
#![feature(trait_alias)]
|
||||
#![feature(option_expect_none)]
|
||||
#![feature(option_get_or_default)]
|
||||
#![feature(or_patterns)]
|
||||
#![feature(once_cell)]
|
||||
#![feature(control_flow_enum)]
|
||||
|
|
|
@ -392,10 +392,7 @@ impl BasicCoverageBlockData {
|
|||
}
|
||||
}
|
||||
let operand = counter_kind.as_operand_id();
|
||||
if let Some(replaced) = self
|
||||
.edge_from_bcbs
|
||||
.get_or_insert_with(FxHashMap::default)
|
||||
.insert(from_bcb, counter_kind)
|
||||
if let Some(replaced) = self.edge_from_bcbs.get_or_default().insert(from_bcb, counter_kind)
|
||||
{
|
||||
Error::from_string(format!(
|
||||
"attempt to set an edge counter more than once; from_bcb: \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue