Skip to content

Add try_filter_map_results method. #2

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

Open
wants to merge 4 commits into
base: feature/try_map_results
Choose a base branch
from

Conversation

gin-ahirsch
Copy link

You may wanna hold off merging this until rust-itertools#377 (comment) (compatibility with Rust 1.24) is resolved. This commit also uses {Option,Result}::transpose(), which is not available in that version.

@gin-ahirsch gin-ahirsch force-pushed the feature/try_map_results branch from fa5b1f7 to f9a21a4 Compare October 29, 2019 14:49
@gin-ahirsch
Copy link
Author

After actually using this, while conceptually I think it makes more sense to have the closure return a Option<Result>, it's inconvenient that the try-operator ? does not work in the closure. Thus I changed it to expect the return-type Result<Option> instead.

Also remove calls to Result::transpose() to stay compatible to Rust
1.24.
@pthariensflame pthariensflame force-pushed the feature/try_map_results branch from 95342cb to b3f31e7 Compare April 16, 2020 00:35
@pthariensflame pthariensflame force-pushed the feature/try_map_results branch from b3f31e7 to 389acab Compare July 6, 2020 07:14
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