Makes QueryResult::read lifetimes better

pull/10/head
Tpt 5 years ago
parent cac68a4473
commit 7acb99ab13
  1. 5
      lib/src/sparql/model.rs
  2. 2
      lib/src/sparql/xml_results.rs

@ -17,10 +17,7 @@ pub enum QueryResult<'a> {
}
impl<'a> QueryResult<'a> {
pub fn read(
reader: impl BufRead + 'static,
syntax: QueryResultSyntax,
) -> Result<QueryResult<'static>> {
pub fn read(reader: impl BufRead + 'a, syntax: QueryResultSyntax) -> Result<Self> {
match syntax {
QueryResultSyntax::Xml => read_xml_results(reader),
}

@ -107,7 +107,7 @@ pub fn write_xml_results<W: Write>(results: QueryResult<'_>, sink: W) -> Result<
Ok(writer.into_inner())
}
pub fn read_xml_results(source: impl BufRead + 'static) -> Result<QueryResult<'static>> {
pub fn read_xml_results<'a>(source: impl BufRead + 'a) -> Result<QueryResult<'a>> {
enum State {
Start,
Sparql,

Loading…
Cancel
Save