mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 09:34:50 +00:00
refactor(daedalus_client): replace serde-xml-rs with quick-xml (#7185)
quick-xml is already the de facto XML (de)serializer used elsewhere in the workspace (labrinth, app-lib), so consolidate on it here too. Its serde feature deserializes the existing maven-metadata.xml structs without any changes. Drops one redundant dependency from the workspace.
This commit is contained in:
@@ -11,7 +11,7 @@ pub enum ErrorKind {
|
||||
#[error("Error while deserializing JSON: {0}")]
|
||||
SerdeJSON(#[from] serde_json::Error),
|
||||
#[error("Error while deserializing XML: {0}")]
|
||||
SerdeXML(#[from] serde_xml_rs::Error),
|
||||
QuickXML(#[from] quick_xml::DeError),
|
||||
#[error(
|
||||
"Failed to validate file checksum at url {url} with hash {hash} after {tries} tries"
|
||||
)]
|
||||
|
||||
@@ -304,7 +304,7 @@ pub async fn fetch_xml<T: DeserializeOwned>(
|
||||
url: &str,
|
||||
semaphore: &Arc<Semaphore>,
|
||||
) -> Result<T, Error> {
|
||||
Ok(serde_xml_rs::from_reader(
|
||||
Ok(quick_xml::de::from_reader(
|
||||
&*download_file(url, None, semaphore).await?,
|
||||
)?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user