From 2281575c146f3065af59c2fc9324d7482a4d2294 Mon Sep 17 00:00:00 2001 From: Tpt Date: Tue, 13 Jun 2023 21:16:23 +0200 Subject: [PATCH] GraphName: implements Default --- lib/oxrdf/src/triple.rs | 6 ++++-- lib/spargebra/src/term.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/oxrdf/src/triple.rs b/lib/oxrdf/src/triple.rs index c0328f46..850b1375 100644 --- a/lib/oxrdf/src/triple.rs +++ b/lib/oxrdf/src/triple.rs @@ -853,10 +853,11 @@ impl<'a> From> for Triple { /// A possible owned graph name. /// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph). -#[derive(Eq, PartialEq, Debug, Clone, Hash)] +#[derive(Eq, PartialEq, Debug, Clone, Hash, Default)] pub enum GraphName { NamedNode(NamedNode), BlankNode(BlankNode), + #[default] DefaultGraph, } @@ -940,10 +941,11 @@ impl From> for GraphName { /// A possible borrowed graph name. /// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph). -#[derive(Eq, PartialEq, Debug, Clone, Copy, Hash)] +#[derive(Eq, PartialEq, Debug, Clone, Copy, Hash, Default)] pub enum GraphNameRef<'a> { NamedNode(NamedNodeRef<'a>), BlankNode(BlankNodeRef<'a>), + #[default] DefaultGraph, } diff --git a/lib/spargebra/src/term.rs b/lib/spargebra/src/term.rs index 8c41fc1b..6a33294c 100644 --- a/lib/spargebra/src/term.rs +++ b/lib/spargebra/src/term.rs @@ -183,9 +183,10 @@ impl TryFrom for GroundTriple { /// A possible graph name. /// /// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri) and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph). -#[derive(Eq, PartialEq, Debug, Clone, Hash)] +#[derive(Eq, PartialEq, Debug, Clone, Hash, Default)] pub enum GraphName { NamedNode(NamedNode), + #[default] DefaultGraph, }