Get rid of IntoElements, replace it with Into<Node> and <T: Into<Node> IntoIterator<Item = T>. This is a backwards-incompatible change, but should require minimal changes.

Doing this splits the `append` method in `ElementBuilder` into two methods. `append` now appends exactly one node, while `append_all` appends an iterator of nodes.

Add `remove_child`, which removes the first child that has a specific name and namespace, then returns it if it exists.

Add a lot of convenience methods on `Node`: `as_text_mut`, `as_element_mut`, `into_text`, `into_element`.
This commit is contained in:
lumi 2018-12-23 15:40:23 +01:00
commit c5c8dee20a
3 changed files with 162 additions and 90 deletions

View file

@ -77,4 +77,4 @@ mod namespace_set;
pub use error::{Error, Result};
pub use element::{Element, Node, Children, ChildrenMut, ElementBuilder};
pub use convert::{IntoElements, IntoAttributeValue, ElementEmitter};
pub use convert::IntoAttributeValue;