mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-13 09:01:05 +00:00
Add Send and Sync on Error Source (#118)
* Add Send and Sync on Error Source and remove 'static * Add back 'static * Update the changelog
This commit is contained in:
parent
b7e1eff9b7
commit
c8a93357cf
3 changed files with 8 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::error::ErrorSource;
|
||||
use crate::GDError;
|
||||
use std::error::Error;
|
||||
|
||||
/// All GameDig Error kinds.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
|
|
@ -44,7 +44,7 @@ impl GDErrorKind {
|
|||
/// use gamedig::{GDErrorKind, GDResult};
|
||||
/// let _: GDResult<u32> = "thing".parse().map_err(|e| GDErrorKind::TypeParse.context(e));
|
||||
/// ```
|
||||
pub fn context<E: Into<Box<dyn Error + 'static>>>(self, source: E) -> GDError { GDError::from_error(self, source) }
|
||||
pub fn context<E: Into<ErrorSource>>(self, source: E) -> GDError { GDError::from_error(self, source) }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue