mirror of
https://github.com/modrinth/code.git
synced 2026-08-24 16:44:51 +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:
Generated
+1
-13
@@ -2676,10 +2676,10 @@ dependencies = [
|
||||
"futures",
|
||||
"indexmap 2.11.4",
|
||||
"itertools 0.14.0",
|
||||
"quick-xml 0.38.3",
|
||||
"reqwest 0.12.24",
|
||||
"rust-s3",
|
||||
"serde",
|
||||
"serde-xml-rs",
|
||||
"serde_json",
|
||||
"sha1_smol",
|
||||
"thiserror 2.0.17",
|
||||
@@ -9433,18 +9433,6 @@ dependencies = [
|
||||
"typeid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde-xml-rs"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53630160a98edebde0123eb4dfd0fce6adff091b2305db3154a9e920206eb510"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
"thiserror 1.0.69",
|
||||
"xml-rs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_bytes"
|
||||
version = "0.11.19"
|
||||
|
||||
@@ -192,7 +192,6 @@ serde_cbor = "0.11.2"
|
||||
serde_ini = "0.2.0"
|
||||
serde_json = "1.0.145"
|
||||
serde_with = "3.15.0"
|
||||
serde-xml-rs = "0.8.1" # Also an XML (de)serializer, consider dropping yaserde in favor of this
|
||||
sha1 = "0.10.6"
|
||||
sha1_smol = { version = "1.0.1", features = ["std"] }
|
||||
sha2 = "0.10.9"
|
||||
|
||||
@@ -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