Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/kit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ itertools = "0.15.0"
camino = "1.1.12"
comfy-table = "8.0"
strum = { version = "0.28", features = ["derive"] }
quick-xml = "0.41"
quick-xml = "0.42"
oci-spec = "0.10.0"
sha2 = "0.11"
which = "8.0"
Expand Down
20 changes: 9 additions & 11 deletions crates/kit/src/xml_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ pub fn parse_xml_dom(xml: &str) -> Result<XmlNode> {
loop {
match reader.read_event_into(&mut buf) {
Ok(Event::Start(e)) => {
let name = String::from_utf8_lossy(e.name().as_ref()).into_owned();
let name = e.name().into_inner().to_owned();
let mut attributes = HashMap::new();

for attr in e.attributes() {
if let Ok(attr) = attr {
let key = String::from_utf8_lossy(attr.key.as_ref()).into_owned();
let value = String::from_utf8_lossy(&attr.value).into_owned();
let key = attr.key.into_inner().to_owned();
let value = attr.value.into_owned();
attributes.insert(key, value);
}
}
Expand All @@ -189,13 +189,13 @@ pub fn parse_xml_dom(xml: &str) -> Result<XmlNode> {
stack.push(node);
}
Ok(Event::Empty(e)) => {
let name = String::from_utf8_lossy(e.name().as_ref()).into_owned();
let name = e.name().into_inner().to_owned();
let mut attributes = HashMap::new();

for attr in e.attributes() {
if let Ok(attr) = attr {
let key = String::from_utf8_lossy(attr.key.as_ref()).into_owned();
let value = String::from_utf8_lossy(&attr.value).into_owned();
let key = attr.key.into_inner().to_owned();
let value = attr.value.into_owned();
attributes.insert(key, value);
}
}
Expand Down Expand Up @@ -224,11 +224,9 @@ pub fn parse_xml_dom(xml: &str) -> Result<XmlNode> {
}
}
Ok(Event::Text(e)) => {
if let Ok(decoded) = e.decode() {
if let Ok(text) = unescape(&decoded) {
if let Some(current) = stack.last_mut() {
current.text.push_str(&text);
}
if let Ok(text) = unescape(&e) {
if let Some(current) = stack.last_mut() {
current.text.push_str(&text);
}
}
}
Expand Down