Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in Array::iter and Array::to_vec #1909

Merged
merged 2 commits into from
Dec 17, 2019

Conversation

Pauan
Copy link
Contributor

@Pauan Pauan commented Dec 14, 2019

There's a few reasons for this:

  • Using array.to_vec() is more convenient and more efficient than using array.values().into_iter().map(|x| x.unwrap_throw()).collect::<Vec<_>>()

  • Using array.iter() is much more efficient than using array.values().into_iter()

  • The iterator returned by array.iter() supports size_hint, ExactSizeIterator, and DoubleEndedIterator, all of which cannot be supported by array.values()

@alexcrichton
Copy link
Contributor

Looks great to me, thanks!

@alexcrichton alexcrichton merged commit 221514a into rustwasm:master Dec 17, 2019
@alexcrichton
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants