From 7acb99ab137a6a6ac16b89140b43688eab262d8c Mon Sep 17 00:00:00 2001 From: Tpt Date: Wed, 21 Aug 2019 21:27:18 +0200 Subject: [PATCH] Makes QueryResult::read lifetimes better --- lib/src/sparql/model.rs | 5 +---- lib/src/sparql/xml_results.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/src/sparql/model.rs b/lib/src/sparql/model.rs index 0072b174..6ec50041 100644 --- a/lib/src/sparql/model.rs +++ b/lib/src/sparql/model.rs @@ -17,10 +17,7 @@ pub enum QueryResult<'a> { } impl<'a> QueryResult<'a> { - pub fn read( - reader: impl BufRead + 'static, - syntax: QueryResultSyntax, - ) -> Result> { + pub fn read(reader: impl BufRead + 'a, syntax: QueryResultSyntax) -> Result { match syntax { QueryResultSyntax::Xml => read_xml_results(reader), } diff --git a/lib/src/sparql/xml_results.rs b/lib/src/sparql/xml_results.rs index 2d9cead6..7a5bfa9a 100644 --- a/lib/src/sparql/xml_results.rs +++ b/lib/src/sparql/xml_results.rs @@ -107,7 +107,7 @@ pub fn write_xml_results(results: QueryResult<'_>, sink: W) -> Result< Ok(writer.into_inner()) } -pub fn read_xml_results(source: impl BufRead + 'static) -> Result> { +pub fn read_xml_results<'a>(source: impl BufRead + 'a) -> Result> { enum State { Start, Sparql,