Allow Builder as Into<Vec<Node>>
continuous-integration/drone/pr Build encountered an error
Details
continuous-integration/drone/pr Build encountered an error
Details
This commit is contained in:
parent
2f3dd72d90
commit
a7fabdc909
|
@ -87,6 +87,15 @@ impl AsMut<[Node]> for Builder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Builder> for Vec<Node> {
|
||||||
|
/// Convert into a collection of [`Node`]s.
|
||||||
|
///
|
||||||
|
/// Equivilent to calling [`Builder::build()`]
|
||||||
|
fn from(builder: Builder) -> Self {
|
||||||
|
builder.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Render a set of nodes as a document to a writer.
|
/// Render a set of nodes as a document to a writer.
|
||||||
pub fn render(nodes: impl AsRef<[Node]>, out: &mut impl Write) -> io::Result<()> {
|
pub fn render(nodes: impl AsRef<[Node]>, out: &mut impl Write) -> io::Result<()> {
|
||||||
use Node::*;
|
use Node::*;
|
||||||
|
|
Loading…
Reference in New Issue