Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Clarify iteration behavior for causes by splitting it in two methods #232

Merged
merged 2 commits into from
Jul 31, 2018

Conversation

mitsuhiko
Copy link
Contributor

This changes the new iter_causes method to really only include causes
and add iter_chain to iterate over the entire chain including the
outermost fail.

@matklad
Copy link
Contributor

matklad commented Jul 28, 2018

An interesting observation is that, I think, one typically uses .causes just to print the errors. So, the need for these methods might be significantly reduced if a Display impl just did the right thing from the start.

@mitsuhiko
Copy link
Contributor Author

Display in itself can’t but i want to add a method that returns a formattable object that prints all causes. I just did not want to cram that into this release.

@mitsuhiko
Copy link
Contributor Author

@matklad I added this as an experiment. It's based on how we render our own failures: #233

@mitsuhiko
Copy link
Contributor Author

I'm going to merge this.

@mitsuhiko mitsuhiko merged commit 94158d2 into master Jul 31, 2018
@mitsuhiko mitsuhiko deleted the feature/iter-causes branch July 31, 2018 19:15
zackmdavis added a commit to zackmdavis/rustfix that referenced this pull request Aug 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants