diff --git a/ldp/src/rdf_source.rs b/ldp/src/rdf_source.rs index 271b958..b265a78 100644 --- a/ldp/src/rdf_source.rs +++ b/ldp/src/rdf_source.rs @@ -100,12 +100,12 @@ impl RdfSource { } /// Holds options related to serialization. -pub struct SerializationOptions { +pub struct SerializationOptions<'a> { format: RdfFormat, - filter: Box) -> bool>, + filter: Box) -> bool>, } -impl SerializationOptions { +impl<'a> SerializationOptions<'a> { /// Create a new set of serialization options with the provided format. pub fn from_format(format: RdfFormat) -> Self { Self { @@ -120,7 +120,7 @@ impl SerializationOptions { #[must_use] pub fn with_filter(self, filter: F) -> Self where - F: Fn(TripleRef<'_>) -> bool + 'static, + F: Fn(TripleRef<'a>) -> bool + 'static, { Self { format: self.format, @@ -134,7 +134,7 @@ where &'a D: IntoIterator>, { /// Serializes the dataset in to the provided format. - pub fn serialize(&'a self, options: SerializationOptions) -> crate::Result { + pub fn serialize(&'a self, options: SerializationOptions<'a>) -> crate::Result { let writer = bytes::BytesMut::new().writer(); let mut serializer = RdfSerializer::from_format(options.format).for_writer(writer); @@ -159,7 +159,7 @@ where /// Prepare an update request. pub fn to_update( &'a self, - options: SerializationOptions, + options: SerializationOptions<'a>, ) -> crate::Result { let url = self.described_by.clone().unwrap_or(self.origin.clone()); let media_type = options.format.media_type().to_string();