commit | dd4ea8cf86902233cd4af1df8fed97cca1b99c82 | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Wed May 22 23:23:15 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed May 22 23:23:15 2024 +0000 |
tree | 2b154e0fcffd1f06829b7c784fe6a3a0a4f52cf4 | |
parent | 66860b37c4858593eed44ed1ae9bef061e771cc3 [diff] | |
parent | 6eeb87530f10840cc748f630ded70ff2058d1d71 [diff] |
Update Android.bp by running cargo_embargo am: 6eeb87530f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/serde-xml-rs/+/3096085 Change-Id: Ib6bd29a1db80b9c7ae3c9fec33af0a2eef680383 Signed-off-by: Automerger Merge Worker <[email protected]>
xml-rs
based deserializer for Serde (compatible with 1.0)
use serde::{Deserialize, Serialize}; use serde_xml_rs::{from_str, to_string}; #[derive(Debug, Serialize, Deserialize, PartialEq)] struct Item { name: String, source: String, } fn main() { let src = r#"<Item><name>Banana</name><source>Store</source></Item>"#; let should_be = Item { name: "Banana".to_string(), source: "Store".to_string(), }; let item: Item = from_str(src).unwrap(); assert_eq!(item, should_be); let reserialized_item = to_string(&item).unwrap(); assert_eq!(src, reserialized_item); }