diff --git a/src/errors.rs b/src/errors.rs index 95263d8..d319f48 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -50,12 +50,10 @@ impl GDErrorKind { /// use gamedig::{GDErrorKind, GDResult}; /// let _: GDResult = "thing".parse().map_err(|e| GDErrorKind::TypeParse.context(e)); /// ``` - pub fn context>>(self, source: E) -> GDError { - GDError::from_error(self, source) - } + pub fn context>>(self, source: E) -> GDError { GDError::from_error(self, source) } } -type ErrorSource = Box; +type ErrorSource = Box; /// Gamedig error type /// @@ -86,7 +84,7 @@ type ErrorSource = Box; pub struct GDError { pub kind: GDErrorKind, pub source: Option, - pub backtrace: Option, + pub backtrace: Option, } impl From for GDError { @@ -130,7 +128,7 @@ impl fmt::Display for GDError { impl GDError { /// Create a new error (with automatic backtrace) pub fn new(kind: GDErrorKind, source: Option) -> Self { - let backtrace = Some(std::backtrace::Backtrace::capture()); + let backtrace = Some(backtrace::Backtrace::capture()); Self { kind, source, @@ -139,7 +137,7 @@ impl GDError { } /// Create a new error using any type that can be converted to an error - pub fn from_error>>(kind: GDErrorKind, source: E) -> Self { + pub fn from_error>>(kind: GDErrorKind, source: E) -> Self { Self::new(kind, Some(source.into())) } }