fix a couple clippy:complexitys
double_parens filter_map_identity needless_question_mark redundant_guards
This commit is contained in:
parent
be01dabfef
commit
dab76eccdf
@ -619,11 +619,11 @@ pub fn eval_condition(
|
|||||||
// we can't use `try_gate_cfg` as symbols don't differentiate between `r#true`
|
// we can't use `try_gate_cfg` as symbols don't differentiate between `r#true`
|
||||||
// and `true`, and we want to keep the former working without feature gate
|
// and `true`, and we want to keep the former working without feature gate
|
||||||
gate_cfg(
|
gate_cfg(
|
||||||
&((
|
&(
|
||||||
if *b { kw::True } else { kw::False },
|
if *b { kw::True } else { kw::False },
|
||||||
sym::cfg_boolean_literals,
|
sym::cfg_boolean_literals,
|
||||||
|features: &Features| features.cfg_boolean_literals(),
|
|features: &Features| features.cfg_boolean_literals(),
|
||||||
)),
|
),
|
||||||
cfg.span(),
|
cfg.span(),
|
||||||
sess,
|
sess,
|
||||||
features,
|
features,
|
||||||
|
@ -277,9 +277,9 @@ pub fn create_dump_file<'tcx>(
|
|||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Ok(fs::File::create_buffered(&file_path).map_err(|e| {
|
fs::File::create_buffered(&file_path).map_err(|e| {
|
||||||
io::Error::new(e.kind(), format!("IO error creating MIR dump file: {file_path:?}; {e}"))
|
io::Error::new(e.kind(), format!("IO error creating MIR dump file: {file_path:?}; {e}"))
|
||||||
})?)
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -363,7 +363,7 @@ fn calc_test_vectors_index(conditions: &mut Vec<MCDCBranch>) -> usize {
|
|||||||
let ConditionInfo { condition_id, true_next_id, false_next_id } = branch.condition_info;
|
let ConditionInfo { condition_id, true_next_id, false_next_id } = branch.condition_info;
|
||||||
[true_next_id, false_next_id]
|
[true_next_id, false_next_id]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(std::convert::identity)
|
.flatten()
|
||||||
.for_each(|next_id| indegree_stats[next_id] += 1);
|
.for_each(|next_id| indegree_stats[next_id] += 1);
|
||||||
(condition_id, branch)
|
(condition_id, branch)
|
||||||
})
|
})
|
||||||
|
@ -87,7 +87,7 @@ fn remove_unwanted_expansion_spans(covspans: &mut Vec<SpanFromMir>) {
|
|||||||
covspans.retain(|covspan| {
|
covspans.retain(|covspan| {
|
||||||
match covspan.expn_kind {
|
match covspan.expn_kind {
|
||||||
// Retain only the first await-related or macro-expanded covspan with this span.
|
// Retain only the first await-related or macro-expanded covspan with this span.
|
||||||
Some(ExpnKind::Desugaring(kind)) if kind == DesugaringKind::Await => {
|
Some(ExpnKind::Desugaring(DesugaringKind::Await)) => {
|
||||||
deduplicated_spans.insert(covspan.span)
|
deduplicated_spans.insert(covspan.span)
|
||||||
}
|
}
|
||||||
Some(ExpnKind::Macro(MacroKind::Bang, _)) => deduplicated_spans.insert(covspan.span),
|
Some(ExpnKind::Macro(MacroKind::Bang, _)) => deduplicated_spans.insert(covspan.span),
|
||||||
|
Loading…
Reference in New Issue
Block a user