minidom: Make the whole crate almost no_std

Only std::io is still missing, maybe we should consider using a crate
implementing its API on top of no_std?
This commit is contained in:
Emmanuel Gil Peyrot 2025-02-25 01:06:30 +01:00 committed by Link Mauve
commit d203a348cb
7 changed files with 33 additions and 27 deletions

View file

@ -12,6 +12,9 @@
use crate::element::Element;
use crate::error::Error;
use alloc::format;
use alloc::string::String;
use alloc::vec::Vec;
const TEST_STRING: &'static [u8] = br#"<root xmlns='root_ns' a="b" xml:lang="en">meow<child c="d"/><child xmlns='child_ns' d="e" xml:lang="fr"/>nya</root>"#;
@ -82,7 +85,7 @@ fn test_real_data() {
.append(body)
.append(correction)
.build();
let stream = Element::builder("stream", "http://etherx.jabber.org/streams")
let _stream = Element::builder("stream", "http://etherx.jabber.org/streams")
.prefix(
Some(String::from("stream")),
"http://etherx.jabber.org/streams",
@ -92,7 +95,6 @@ fn test_real_data() {
.unwrap()
.append(message)
.build();
println!("{}", String::from(&stream));
let jid = Element::builder("jid", "urn:xmpp:presence:0").build();
let nick = Element::builder("nick", "urn:xmpp:presence:0").build();
@ -119,7 +121,7 @@ fn test_real_data() {
let iq = Element::builder("iq", "jabber:client")
.append(pubsub)
.build();
let stream = Element::builder("stream", "http://etherx.jabber.org/streams")
let _stream = Element::builder("stream", "http://etherx.jabber.org/streams")
.prefix(
Some(String::from("stream")),
"http://etherx.jabber.org/streams",
@ -129,8 +131,6 @@ fn test_real_data() {
.unwrap()
.append(iq)
.build();
println!("{}", String::from(&stream));
}
#[test]