diff --git a/resource/src/lib.rs b/resource/src/lib.rs index 508961d5..3aff4c93 100644 --- a/resource/src/lib.rs +++ b/resource/src/lib.rs @@ -72,7 +72,7 @@ mod test { pub const F5_LEN: usize = 20; pub type MyGraph = Vec<[SimpleTerm<'static>; 3]>; - pub type TestResult = Result<(), Box>; + pub type TestResult = Result<(), Box>; pub fn make_loader() -> LocalLoader { let ns = NS.map_unchecked(MownStr::from); diff --git a/resource/src/loader/_error.rs b/resource/src/loader/_error.rs index 7368f477..f33febd0 100644 --- a/resource/src/loader/_error.rs +++ b/resource/src/loader/_error.rs @@ -20,7 +20,7 @@ pub enum LoaderError { CantGuessSyntax(IriBuf), /// An error was encountered while parsing the data into an RDF graph #[error("Can not parse {0:?}: {1}")] - ParseError(IriBuf, Box), + ParseError(IriBuf, Box), } impl LoaderError { diff --git a/resource/src/resource/_error.rs b/resource/src/resource/_error.rs index 13b6628f..125786d5 100644 --- a/resource/src/resource/_error.rs +++ b/resource/src/resource/_error.rs @@ -70,7 +70,10 @@ pub enum ResourceError { }, } -impl ResourceError { +impl ResourceError +where + Self: Send + Sync + 'static, +{ /// The identifier of the resource raising the error. /// /// NB: for errors raised during creation ([`ResourceError::IriNotAbsolute`], [`ResourceError::LoaderError`]), @@ -103,7 +106,7 @@ impl From for Reso } } -impl Error for ResourceError {} +impl Error for ResourceError where Self: Send + Sync + 'static {} /// A result whose error is a [`ResourceError`] pub type ResourceResult = Result::Error>>; diff --git a/resource/src/resource/_struct.rs b/resource/src/resource/_struct.rs index 5860800f..fd2062ca 100644 --- a/resource/src/resource/_struct.rs +++ b/resource/src/resource/_struct.rs @@ -22,6 +22,7 @@ pub struct Resource { impl Resource where G: Graph + 'static, + G::Error: Send + Sync + 'static, L: Loader, { /// Constructor diff --git a/resource/src/resource/test.rs b/resource/src/resource/test.rs index 56948db5..467744ad 100644 --- a/resource/src/resource/test.rs +++ b/resource/src/resource/test.rs @@ -597,6 +597,8 @@ fn no_reload() -> TestResult { Ok(()) } -fn make_rsc(iri: Iri<&str>) -> Result, Box> { +fn make_rsc( + iri: Iri<&str>, +) -> Result, Box> { Ok(make_loader().arced().get_resource(iri)?) }