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

Support ? operator in for loops #44170

Closed
estebank opened this issue Aug 30, 2017 · 2 comments
Closed

Support ? operator in for loops #44170

estebank opened this issue Aug 30, 2017 · 2 comments

Comments

@estebank
Copy link
Contributor

Should the following be allowed?

for item? in my_iter {
    ...
}

Every now and then I encounter the need to iterate over Results and end up having to write the following, which isn't onerous but is not ergonomic:

for item in my_iter {
    let item = item?;
    ...
}
@ids1024
Copy link
Contributor

ids1024 commented Aug 30, 2017

This has been requested before: rust-lang/rfcs#2012

@estebank
Copy link
Contributor Author

@ids1024 thanks for linking to it! I'll close this ticket in favor of that RFC.

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

No branches or pull requests

2 participants