mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 11:23:03 +00:00
Remove useless call to combine_seq
`combine_seq(x, NeverLoopResult::Otherwise)` always returns `x`
This commit is contained in:
parent
63562a6854
commit
c231b41887
@ -191,7 +191,7 @@ fn never_loop_expr(expr: &Expr<'_>, ignore_ids: &mut Vec<HirId>, main_loop_id: H
|
|||||||
// checks if break targets a block instead of a loop
|
// checks if break targets a block instead of a loop
|
||||||
ExprKind::Break(Destination { target_id: Ok(t), .. }, e) if ignore_ids.contains(&t) => e
|
ExprKind::Break(Destination { target_id: Ok(t), .. }, e) if ignore_ids.contains(&t) => e
|
||||||
.map_or(NeverLoopResult::Otherwise, |e| {
|
.map_or(NeverLoopResult::Otherwise, |e| {
|
||||||
combine_seq(never_loop_expr(e, ignore_ids, main_loop_id), NeverLoopResult::Otherwise)
|
never_loop_expr(e, ignore_ids, main_loop_id)
|
||||||
}),
|
}),
|
||||||
ExprKind::Break(_, e) | ExprKind::Ret(e) => e.as_ref().map_or(NeverLoopResult::AlwaysBreak, |e| {
|
ExprKind::Break(_, e) | ExprKind::Ret(e) => e.as_ref().map_or(NeverLoopResult::AlwaysBreak, |e| {
|
||||||
combine_seq(
|
combine_seq(
|
||||||
|
Loading…
Reference in New Issue
Block a user