Add must_use annotations where appropriate

This commit is contained in:
2026-05-21 13:08:32 -04:00
parent 938b0a17ab
commit 37db30c57e
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -117,6 +117,7 @@ impl SerializationOptions {
/// Filter triples that match the predicate.
///
/// A return value of `true` means that it the triple ought to be included in the serialization.
#[must_use]
pub fn with_filter<F>(self, filter: F) -> Self
where
F: Fn(TripleRef<'_>) -> bool + 'static,
+4
View File
@@ -46,6 +46,7 @@ impl ResourceRequestBuilder {
}
/// Creates a new request with the given HTTP client.
#[must_use]
pub fn with_client_and_url(client: ClientWithMiddleware, url: Url) -> Self {
Self {
client,
@@ -56,6 +57,7 @@ impl ResourceRequestBuilder {
}
/// If the HTTP response includes a [describedby](https://www.w3.org/TR/ldp/#link-relation-describedby) link rel, then it will be followed.
#[must_use]
pub fn follow_described_by(mut self, value: bool) -> Self {
self.follow_described_by = value;
self
@@ -65,12 +67,14 @@ impl ResourceRequestBuilder {
///
/// Repeated calls are additive. By default, all formats — even non-RDF formats — are accepted.
/// If your intention is to process non-RDF data, then this should not be called.
#[must_use]
pub fn accept_rdf_format(mut self, format: RdfFormat) -> Self {
self.formats.push(format);
self
}
/// Restrict the request to all the formats supported by the underlying parser.
#[must_use]
pub fn accept_all_rdf_formats(mut self) -> Self {
self.formats = vec![
RdfFormat::N3,