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:
CosminPerRam 2023-10-09 19:11:34 +03:00 committed by GitHub
parent b7e1eff9b7
commit c8a93357cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -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)]