about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2019-02-07 16:10:34 +0100
committerHarald Hoyer <harald@hoyer.xyz>2019-02-09 16:04:25 +0100
commitf06af1ff178014dadd62391a4a06e7fff8f2a6a1 (patch)
tree9588f5e1fda722fdf9f4ef40f28cc3c4265e0881 /src/libsyntax/parse
parent825f355c7483746f3a17166f34dfabe3b2df1741 (diff)
downloadrust-f06af1ff178014dadd62391a4a06e7fff8f2a6a1.tar.gz
rust-f06af1ff178014dadd62391a4a06e7fff8f2a6a1.zip
impl iter_sources() and iter_chain() for dyn Error
Examples:

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

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

Credit for the ErrorIter goes to Tim Diekmann
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions