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

Change from using Option to std::iter::once when chaining together Form Iterators. #555

Closed
mitchmindtree opened this issue Sep 3, 2015 · 0 comments
Labels

Comments

@mitchmindtree
Copy link
Contributor

I've used Option throughout the widget draw methods to chain together Form Iterators (in order to avoid allocations), however I think the more idiomatic way would be to use std::iter::once (didn't see it until today).

For example, the line here

Some(circle_form).into_iter().chain(Some(text_form))

would become

once(circle_form).chain(once(text_form))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant