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

Returning anyhow::Result when checking for strictness violations and retrieving packs #155

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

perryqh
Copy link
Contributor

@perryqh perryqh commented Feb 28, 2024

Removing some more panic!s in favor of bubbling up error results

strict_mode_violations
recorded_violations
.iter()
.try_fold(vec![], |mut acc, violation| {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent far too long trying to do this with filter_map and transpose. Then I discovered try_fold!

Copy link
Owner

@alexevanczuk alexevanczuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

@alexevanczuk alexevanczuk merged commit ca3e11d into alexevanczuk:main Feb 28, 2024
6 checks passed
@perryqh perryqh deleted the ph/get-x-pack-result branch March 21, 2024 13:37
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