Prefer iterator over vector in parse_array

Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
This commit is contained in:
Collin Chin 2020-10-27 11:25:43 -07:00 committed by GitHub
parent 0636997ddb
commit e58f00d8b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -763,7 +763,7 @@ impl Frame {
///
/// Returns the type of the array expression.
///
fn parse_array(&mut self, expressions: &Vec<SpreadOrExpression>, span: &Span) -> Result<Type, FrameError> {
fn parse_array(&mut self, expressions: impl Iterator<Item = SpreadOrExpression>, span: &Span) -> Result<Type, FrameError> {
// Store array element type.
let mut element_type = None;
let mut count = 0usize;