From cd36119d882eb9ca3be1b5ec5c7ec7d7aa966efa Mon Sep 17 00:00:00 2001 From: Tpt Date: Wed, 28 Apr 2021 19:33:45 +0200 Subject: [PATCH] Improves nested triples formatting --- lib/src/model/triple.rs | 4 ++-- lib/src/sparql/csv_results.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/model/triple.rs b/lib/src/model/triple.rs index d5a74a3d..3fa60d58 100644 --- a/lib/src/model/triple.rs +++ b/lib/src/model/triple.rs @@ -131,7 +131,7 @@ impl fmt::Display for SubjectRef<'_> { Self::BlankNode(node) => node.fmt(f), Self::Triple(triple) => write!( f, - "<< {} {} {} >>", + "<<{} {} {}>>", triple.subject, triple.predicate, triple.object ), } @@ -373,7 +373,7 @@ impl fmt::Display for TermRef<'_> { Self::Triple(triple) => { write!( f, - "<< {} {} {} >>", + "<<{} {} {}>>", triple.subject, triple.predicate, triple.object ) } diff --git a/lib/src/sparql/csv_results.rs b/lib/src/sparql/csv_results.rs index 4baa0537..21ac1662 100644 --- a/lib/src/sparql/csv_results.rs +++ b/lib/src/sparql/csv_results.rs @@ -166,13 +166,13 @@ fn write_tsv_term<'a>(term: impl Into>, sink: &mut impl Write) -> io _ => sink.write_all(literal.to_string().as_bytes()), }, TermRef::Triple(triple) => { - sink.write_all(b"<< ")?; + sink.write_all(b"<<")?; write_tsv_term(&triple.subject, sink)?; sink.write_all(b" ")?; write_tsv_term(&triple.predicate, sink)?; sink.write_all(b" ")?; write_tsv_term(&triple.object, sink)?; - sink.write_all(b" >>")?; + sink.write_all(b">>")?; Ok(()) } }