1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
#[macro_use]
extern crate alloc;
#[macro_use]
mod util;
mod error;
mod parser;
mod types;
pub type Result<T> = core::result::Result<T, Error>;
pub use crate::error::Error;
pub use crate::types::*;
pub fn parse_document_from_str(s: &str) -> Result<Document> {
crate::parser::parse_document(
&mut xmlparser::Tokenizer::from(s)
.into_iter()
.map(|r| r.map_err(Into::into)),
)
}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
crate::parse_document_from_str(include_str!(
"../test-conf/conf.d/10-scale-bitmap-fonts.conf"
))
.unwrap();
}
}