mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +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:
@@ -20,6 +20,7 @@ dotenvy = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
indexmap = { workspace = true, features = ["serde"] }
|
||||
itertools = { workspace = true }
|
||||
quick-xml = { workspace = true }
|
||||
reqwest = { workspace = true, features = [
|
||||
"json",
|
||||
"rustls-tls-native-roots",
|
||||
@@ -28,7 +29,6 @@ reqwest = { workspace = true, features = [
|
||||
rust-s3 = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
serde-xml-rs = { workspace = true }
|
||||
sha1_smol = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "sync"] }
|
||||
|
||||
@@ -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