diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-12-30 04:19:09 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2021-01-03 13:34:24 +0100 |
| commit | e2272cdffc0e2c658f5a4221f8ce700087d950a4 (patch) | |
| tree | 5f5eece4358bde01b99b0db433e286f4264f0198 /compiler/rustc_mir/src/transform/coverage | |
| parent | 18cb4ad3b9440b3ff2ed16976f56889b23811e13 (diff) | |
remove redundant closures (clippy::redundant_closure)
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage')
| -rw-r--r-- | compiler/rustc_mir/src/transform/coverage/debug.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/transform/coverage/graph.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_mir/src/transform/coverage/debug.rs b/compiler/rustc_mir/src/transform/coverage/debug.rs index b66e37436a6..2cd0dc6b1f2 100644 --- a/compiler/rustc_mir/src/transform/coverage/debug.rs +++ b/compiler/rustc_mir/src/transform/coverage/debug.rs @@ -130,7 +130,7 @@ const RUSTC_COVERAGE_DEBUG_OPTIONS: &str = "RUSTC_COVERAGE_DEBUG_OPTIONS"; pub(super) fn debug_options<'a>() -> &'a DebugOptions { static DEBUG_OPTIONS: SyncOnceCell<DebugOptions> = SyncOnceCell::new(); - &DEBUG_OPTIONS.get_or_init(|| DebugOptions::from_env()) + &DEBUG_OPTIONS.get_or_init(DebugOptions::from_env) } /// Parses and maintains coverage-specific debug options captured from the environment variable @@ -430,7 +430,7 @@ impl GraphvizData { { bcb_to_coverage_spans_with_counters .entry(bcb) - .or_insert_with(|| Vec::new()) + .or_insert_with(Vec::new) .push((coverage_span.clone(), counter_kind.clone())); } } @@ -456,7 +456,7 @@ impl GraphvizData { if let Some(bcb_to_dependency_counters) = self.some_bcb_to_dependency_counters.as_mut() { bcb_to_dependency_counters .entry(bcb) - .or_insert_with(|| Vec::new()) + .or_insert_with(Vec::new) .push(counter_kind.clone()); } } @@ -527,8 +527,8 @@ impl UsedExpressions { pub fn add_expression_operands(&mut self, expression: &CoverageKind) { if let Some(used_expression_operands) = self.some_used_expression_operands.as_mut() { if let CoverageKind::Expression { id, lhs, rhs, .. } = *expression { - used_expression_operands.entry(lhs).or_insert_with(|| Vec::new()).push(id); - used_expression_operands.entry(rhs).or_insert_with(|| Vec::new()).push(id); + used_expression_operands.entry(lhs).or_insert_with(Vec::new).push(id); + used_expression_operands.entry(rhs).or_insert_with(Vec::new).push(id); } } } diff --git a/compiler/rustc_mir/src/transform/coverage/graph.rs b/compiler/rustc_mir/src/transform/coverage/graph.rs index b1a1bb957e7..e58b915f126 100644 --- a/compiler/rustc_mir/src/transform/coverage/graph.rs +++ b/compiler/rustc_mir/src/transform/coverage/graph.rs @@ -394,7 +394,7 @@ impl BasicCoverageBlockData { let operand = counter_kind.as_operand_id(); if let Some(replaced) = self .edge_from_bcbs - .get_or_insert_with(|| FxHashMap::default()) + .get_or_insert_with(FxHashMap::default) .insert(from_bcb, counter_kind) { Error::from_string(format!( |
