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:
parent
da7de97dce
commit
c5c8dee20a
3 changed files with 162 additions and 90 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue