mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 06:43:20 +03:00
don't allocate a Vec in an Iterator::chain
This commit is contained in:
@@ -202,7 +202,7 @@ fn all_spans_after_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> Vec<Span> {
|
||||
.iter()
|
||||
.skip_while(|inner| inner.hir_id != stmt.hir_id)
|
||||
.map(stmt_source_span)
|
||||
.chain(if let Some(e) = block.expr { vec![e.span] } else { vec![] })
|
||||
.chain(block.expr.map(|e| e.span))
|
||||
.collect();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user