failure/box_std.rs
1use std::error::Error;
2use std::fmt;
3use Fail;
4
5pub struct BoxStd(pub Box<dyn Error + Send + Sync + 'static>);
6
7impl fmt::Display for BoxStd {
8 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9 fmt::Display::fmt(&self.0, f)
10 }
11}
12
13impl fmt::Debug for BoxStd {
14 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
15 fmt::Debug::fmt(&self.0, f)
16 }
17}
18
19impl Fail for BoxStd {}