You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#65557 - haraldh:error_iter_rename, r=sfackler
rename Error::iter_chain() and remove Error::iter_sources()
~~Rename~~
* ~~Error::iter_chain() -> Error::chained()~~
* ~~Error::iter_sources() -> Error::ancestors()~~
* ~~ErrorIter -> Chained and Ancestors~~
according to
rust-lang#58520 (comment)
Tracker:
rust-lang#58520
Edit:
Rename
* Error::iter_chain() -> Error::chained()
* ErrorIter -> Chain
So, it seems, that even Path::ancestors() includes itself. So, to avoid confusion and simplify it more, I reduced PR rust-lang#65557 to only have `chained` and `Chain`.
Rationale:
1. Such iterators are helpful. They should better be stabilized sooner than later.
1. self should be included. It is easy to .skip(1) it. Not including self is harmful because it is harder to add self to the iterator than to remove it.
1. The chosen name should be telling and reflect the fact that self is included. `.chained()` was chosen in honor of error-chain and because the iterator iterates over the chain of errors that is somehow included in self.
1. The resulting iterator is named `Chain` because the `error::Chain` is what we want to have.
0 commit comments