Description: use older branch of crate quick-xml
 This essentially reverts upstream git commit 6cdffd8.
Author: Jonas Smedegaard <dr@jones.dk>
Bug-Debian: https://bugs.debian.org/1086507
Forwarded: not-needed
Last-Update: 2024-11-30
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -60,7 +60,7 @@
 pkg-config = "0.3.25"
 predicates = ">=2.0, <4.0"
 pyo3 = "0.25"
-quick-xml = "0.37"
+quick-xml = "0.36.1"
 rand = "0.8"
 rayon = "1.8.1"
 rayon-core = "1.12.1"
--- a/lib/oxrdfxml/src/error.rs
+++ b/lib/oxrdfxml/src/error.rs
@@ -1,7 +1,5 @@
 use oxilangtag::LanguageTagParseError;
 use oxiri::IriParseError;
-use quick_xml::encoding::EncodingError;
-use quick_xml::events::attributes::AttrError;
 use std::io;
 use std::sync::Arc;
 
@@ -39,20 +37,6 @@
     }
 }
 
-#[doc(hidden)]
-impl From<EncodingError> for RdfXmlParseError {
-    fn from(error: EncodingError) -> Self {
-        quick_xml::Error::from(error).into()
-    }
-}
-
-#[doc(hidden)]
-impl From<AttrError> for RdfXmlParseError {
-    fn from(error: AttrError) -> Self {
-        quick_xml::Error::from(error).into()
-    }
-}
-
 /// An error in the syntax of the parsed file.
 #[derive(Debug, thiserror::Error)]
 #[error(transparent)]
--- a/lib/oxrdfxml/src/serializer.rs
+++ b/lib/oxrdfxml/src/serializer.rs
@@ -8,7 +8,6 @@
 use std::collections::BTreeMap;
 use std::io;
 use std::io::Write;
-#[cfg(feature = "async-tokio")]
 use std::sync::Arc;
 #[cfg(feature = "async-tokio")]
 use tokio::io::AsyncWrite;
@@ -248,7 +247,7 @@
 
     fn flush_buffer(&mut self, buffer: &mut Vec<Event<'_>>) -> io::Result<()> {
         for event in buffer.drain(0..) {
-            self.writer.write_event(event)?;
+            self.writer.write_event(event).map_err(map_err)?;
         }
         Ok(())
     }
@@ -382,7 +381,7 @@
             #[allow(clippy::match_wildcard_for_single_variants, unreachable_patterns)]
             match triple.subject {
                 SubjectRef::NamedNode(node) => description_open
-                    .push_attribute(("rdf:about", relative_iri(node.as_str(), &self.base_iri))),
+                    .push_attribute(("rdf:about", relative_iri(node.as_str(), &self.base_iri).as_ref())),
                 SubjectRef::BlankNode(node) => {
                     description_open.push_attribute(("rdf:nodeID", node.as_str()))
                 }
@@ -414,7 +413,7 @@
         let content = match triple.object {
             TermRef::NamedNode(node) => {
                 property_open
-                    .push_attribute(("rdf:resource", relative_iri(node.as_str(), &self.base_iri)));
+                    .push_attribute(("rdf:resource", relative_iri(node.as_str(), &self.base_iri).as_ref()));
                 None
             }
             TermRef::BlankNode(node) => {
@@ -427,7 +426,7 @@
                 } else if !literal.is_plain() {
                     property_open.push_attribute((
                         "rdf:datatype",
-                        relative_iri(literal.datatype().as_str(), &self.base_iri),
+                        relative_iri(literal.datatype().as_str(), &self.base_iri).as_ref(),
                     ));
                 }
                 Some(literal.value())
@@ -510,7 +509,6 @@
     }
 }
 
-#[cfg(feature = "async-tokio")]
 fn map_err(error: quick_xml::Error) -> io::Error {
     if let quick_xml::Error::Io(error) = error {
         Arc::try_unwrap(error).unwrap_or_else(|error| io::Error::new(error.kind(), error))
--- a/lib/sparesults/src/error.rs
+++ b/lib/sparesults/src/error.rs
@@ -1,6 +1,5 @@
 use json_event_parser::{JsonParseError, JsonSyntaxError};
 use oxrdf::TermParseError;
-use quick_xml::encoding::EncodingError;
 use std::io;
 use std::ops::Range;
 use std::sync::Arc;
@@ -156,13 +155,6 @@
     }
 }
 
-#[doc(hidden)]
-impl From<EncodingError> for QueryResultsParseError {
-    fn from(error: EncodingError) -> Self {
-        quick_xml::Error::from(error).into()
-    }
-}
-
 /// A position in a text i.e. a `line` number starting from 0, a `column` number starting from 0 (in number of code points) and a global file `offset` starting from 0 (in number of bytes).
 #[derive(Eq, PartialEq, Debug, Clone, Copy)]
 pub struct TextPosition {
--- a/lib/sparesults/src/xml.rs
+++ b/lib/sparesults/src/xml.rs
@@ -11,7 +11,6 @@
 use std::collections::HashMap;
 use std::io::{self, BufReader, Read, Write};
 use std::mem::take;
-#[cfg(feature = "async-tokio")]
 use std::sync::Arc;
 #[cfg(feature = "async-tokio")]
 use tokio::io::{AsyncRead, AsyncWrite, BufReader as AsyncBufReader};
@@ -19,7 +18,7 @@
 pub fn write_boolean_xml_result<W: Write>(writer: W, value: bool) -> io::Result<W> {
     let mut writer = Writer::new(writer);
     for event in inner_write_boolean_xml_result(value) {
-        writer.write_event(event)?;
+        writer.write_event(event).map_err(map_xml_error)?;
     }
     Ok(writer.into_inner())
 }
@@ -87,7 +86,7 @@
 
     fn do_write(writer: &mut Writer<W>, output: Vec<Event<'_>>) -> io::Result<()> {
         for event in output {
-            writer.write_event(event)?;
+            writer.write_event(event).map_err(map_xml_error)?;
         }
         Ok(())
     }
@@ -955,7 +954,6 @@
     output.into()
 }
 
-#[cfg(feature = "async-tokio")]
 fn map_xml_error(error: Error) -> io::Error {
     match error {
         Error::Io(error) => {
--- a/lints/test_debian_compatibility.py
+++ b/lints/test_debian_compatibility.py
@@ -12,8 +12,7 @@
     "oxhttp",
     "rustc-hash",
     "geo",
-    "wkt",
-    "quick-xml"
+    "wkt"
 }
 
 base_path = Path(__file__).parent.parent
