mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 01:17:16 +00:00
Use flatten instead of filter_map
This commit is contained in:
parent
a60c143fe0
commit
fbe436b1d4
1 changed files with 1 additions and 1 deletions
|
@ -739,7 +739,7 @@ fn combine_branches(b1: NeverLoopResult, b2: NeverLoopResult) -> NeverLoopResult
|
|||
fn never_loop_block(block: &Block<'_>, main_loop_id: HirId) -> NeverLoopResult {
|
||||
let stmts = block.stmts.iter().map(stmt_to_expr);
|
||||
let expr = once(block.expr.as_deref());
|
||||
let mut iter = stmts.chain(expr).filter_map(|e| e);
|
||||
let mut iter = stmts.chain(expr).flatten();
|
||||
never_loop_expr_seq(&mut iter, main_loop_id)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue