Skip to content

Commit

Permalink
Impl Loader for &L.
Browse files Browse the repository at this point in the history
  • Loading branch information
timothee-haudebourg committed Jun 28, 2024
1 parent c02d276 commit 5a15c03
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/core/src/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,20 @@ pub trait Loader {
async fn load(&self, url: &Iri) -> Result<RemoteDocument<IriBuf>, LoadError>;
}

impl<'l, L: Loader> Loader for &'l L {
async fn load_with<V>(&self, vocabulary: &mut V, url: V::Iri) -> LoadingResult<V::Iri>
where
V: IriVocabularyMut,
V::Iri: Clone + Eq + Hash,
{
L::load_with(self, vocabulary, url).await
}

async fn load(&self, url: &Iri) -> Result<RemoteDocument<IriBuf>, LoadError> {
L::load(self, url).await
}
}

impl<'l, L: Loader> Loader for &'l mut L {
async fn load_with<V>(&self, vocabulary: &mut V, url: V::Iri) -> LoadingResult<V::Iri>
where
Expand Down

0 comments on commit 5a15c03

Please sign in to comment.