]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #58289 - haraldh:master, r=sfackler
authorMazdak Farrokhzad <twingoow@gmail.com>
Wed, 13 Feb 2019 03:37:05 +0000 (04:37 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Feb 2019 03:37:05 +0000 (04:37 +0100)
commit5aa260a4b56b30e553f82ed31cba384cbf40ae5d
tree04ba2864a6be39c38965841e816ad2f3a8598fb7
parent0bc8f6f3f4ecfa3309aaa4df52fb4aa1ddd63b07
parentf06af1ff178014dadd62391a4a06e7fff8f2a6a1
Rollup merge of #58289 - haraldh:master, r=sfackler

impl iter() for dyn Error

Examples:

```rust
let next_error_type_a = err
    .iter()
    .filter_map(Error::downcast_ref::<ErrorTypeA>)
    .next();
```

```rust
let source_root_error = err.iter().last();
```

Credit for the ErrorIter goes to reddit user /u/tdiekmann (Tim Diekmann)
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/
src/libstd/error.rs