mirror of
https://github.com/eyre-rs/eyre.git
synced 2025-09-28 21:41:58 +00:00
Move Chain implementation to chain.rs
This commit is contained in:
parent
7246344a3e
commit
a8c199b37d
12
src/chain.rs
Normal file
12
src/chain.rs
Normal file
@ -0,0 +1,12 @@
|
||||
use crate::Chain;
|
||||
use std::error::Error as StdError;
|
||||
|
||||
impl<'a> Iterator for Chain<'a> {
|
||||
type Item = &'a (dyn StdError + 'static);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let next = self.next?;
|
||||
self.next = next.source();
|
||||
Some(next)
|
||||
}
|
||||
}
|
10
src/error.rs
10
src/error.rs
@ -726,13 +726,3 @@ impl From<Error> for Box<dyn StdError + 'static> {
|
||||
Box::<dyn StdError + Send + Sync>::from(error)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Iterator for Chain<'a> {
|
||||
type Item = &'a (dyn StdError + 'static);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let next = self.next?;
|
||||
self.next = next.source();
|
||||
Some(next)
|
||||
}
|
||||
}
|
||||
|
@ -169,6 +169,7 @@
|
||||
|
||||
#[macro_use]
|
||||
mod backtrace;
|
||||
mod chain;
|
||||
mod context;
|
||||
mod error;
|
||||
mod fmt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user