errors: add sync marker to error cause

Errors cause should be shared to let anyhow to wrap it.

Fixes: #7

Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
bin liu
2020-09-14 15:22:55 +08:00
parent d20e6a5383
commit 42685bbfe9

View File

@@ -45,7 +45,7 @@ pub enum ErrorKind {
#[derive(Debug)]
pub struct Error {
kind: ErrorKind,
cause: Option<Box<StdError + Send>>,
cause: Option<Box<StdError + Send + Sync>>,
}
impl fmt::Display for Error {
@@ -88,7 +88,7 @@ impl Error {
pub(crate) fn with_cause<E>(kind: ErrorKind, cause: E) -> Self
where
E: 'static + Send + StdError,
E: 'static + Send + Sync + StdError,
{
Self {
kind,