Update to edition 2018
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
11a5c49470
commit
5aee776f66
5 changed files with 16 additions and 16 deletions
|
|
@ -1,3 +1,6 @@
|
|||
Version XXX, released YYY:
|
||||
* Changes
|
||||
* Update edition to 2018
|
||||
Version 0.11.1, released 2019-09-06:
|
||||
* Changes
|
||||
* Update to quick-xml 0.16
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ documentation = "https://docs.rs/minidom"
|
|||
readme = "README.md"
|
||||
keywords = ["xml"]
|
||||
license = "MIT"
|
||||
edition = "2018"
|
||||
|
||||
[badges]
|
||||
gitlab = { repository = "lumi/minidom-rs" }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
//! Provides an `Element` type, which represents DOM nodes, and a builder to create them with.
|
||||
|
||||
use crate::convert::IntoAttributeValue;
|
||||
use crate::error::{Error, Result};
|
||||
use crate::namespace_set::NamespaceSet;
|
||||
use crate::node::Node;
|
||||
|
||||
use std::io:: Write;
|
||||
use std::collections::{btree_map, BTreeMap};
|
||||
|
||||
|
|
@ -7,8 +12,6 @@ use std::str;
|
|||
use std::rc::Rc;
|
||||
use std::borrow::Cow;
|
||||
|
||||
use error::{Error, Result};
|
||||
|
||||
use quick_xml::Reader as EventReader;
|
||||
use quick_xml::Writer as EventWriter;
|
||||
use quick_xml::events::{Event, BytesStart, BytesEnd, BytesDecl};
|
||||
|
|
@ -19,10 +22,6 @@ use std::str::FromStr;
|
|||
|
||||
use std::slice;
|
||||
|
||||
use convert::IntoAttributeValue;
|
||||
use namespace_set::NamespaceSet;
|
||||
use node::Node;
|
||||
|
||||
/// helper function to escape a `&[u8]` and replace all
|
||||
/// xml special characters (<, >, &, ', ") with their corresponding
|
||||
/// xml escaped value.
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
//! Provides the `Node` struct, which represents a node in the DOM.
|
||||
|
||||
use crate::element::{Element, ElementBuilder};
|
||||
use crate::error::Result;
|
||||
|
||||
use std::io::Write;
|
||||
|
||||
use quick_xml::Writer as EventWriter;
|
||||
use quick_xml::events::{Event, BytesText};
|
||||
|
||||
use error::Result;
|
||||
|
||||
use element::{Element, ElementBuilder};
|
||||
|
||||
/// A node in an element tree.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum Node {
|
||||
|
|
|
|||
10
src/tests.rs
10
src/tests.rs
|
|
@ -1,9 +1,7 @@
|
|||
use std::iter::Iterator;
|
||||
use crate::element::Element;
|
||||
|
||||
use quick_xml::Reader;
|
||||
|
||||
use element::Element;
|
||||
|
||||
const TEST_STRING: &'static str = r#"<?xml version="1.0" encoding="utf-8"?><root xmlns="root_ns" a="b" xml:lang="en">meow<child c="d"/><child xmlns="child_ns" d="e" xml:lang="fr"/>nya</root>"#;
|
||||
|
||||
fn build_test_tree() -> Element {
|
||||
|
|
@ -234,12 +232,12 @@ fn write_comments() {
|
|||
#[test]
|
||||
fn xml_error() {
|
||||
match "<a></b>".parse::<Element>() {
|
||||
Err(::error::Error::XmlError(_)) => (),
|
||||
Err(crate::error::Error::XmlError(_)) => (),
|
||||
err => panic!("No or wrong error: {:?}", err)
|
||||
}
|
||||
|
||||
match "<a></".parse::<Element>() {
|
||||
Err(::error::Error::XmlError(_)) => (),
|
||||
Err(crate::error::Error::XmlError(_)) => (),
|
||||
err => panic!("No or wrong error: {:?}", err)
|
||||
}
|
||||
}
|
||||
|
|
@ -247,7 +245,7 @@ fn xml_error() {
|
|||
#[test]
|
||||
fn invalid_element_error() {
|
||||
match "<a:b:c>".parse::<Element>() {
|
||||
Err(::error::Error::InvalidElement) => (),
|
||||
Err(crate::error::Error::InvalidElement) => (),
|
||||
err => panic!("No or wrong error: {:?}", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue