summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-08-30 01:55:53 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-08-30 01:56:46 +0200
commita666f700240350cda0e8bbe9775837bc5d5024e8 (patch)
tree342c1c6246339b0c223964e876e81dc27b4ef23e /src
parent2ebe09dacb12d1d0c02acbd55e2387b052616f47 (diff)
downloadiced-a666f700240350cda0e8bbe9775837bc5d5024e8.tar.gz
iced-a666f700240350cda0e8bbe9775837bc5d5024e8.tar.bz2
iced-a666f700240350cda0e8bbe9775837bc5d5024e8.zip
Expose `Node::with_children`
Diffstat (limited to 'src')
-rw-r--r--src/node.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/node.rs b/src/node.rs
index cd6b76bb..1db10d7f 100644
--- a/src/node.rs
+++ b/src/node.rs
@@ -24,17 +24,6 @@ impl Node {
Self::with_children(style, Vec::new())
}
- /// Creates a new [`Node`] with the given [`Style`] and children.
- ///
- /// [`Node`]: struct.Node.html
- /// [`Style`]: struct.Style.html
- pub(crate) fn with_children(style: Style, children: Vec<Node>) -> Node {
- Node(node::Node::new(
- style.0,
- children.iter().map(|c| &c.0).collect(),
- ))
- }
-
/// Creates a new [`Node`] with the given [`Style`] and a measure function.
///
/// This type of node cannot have any children.
@@ -57,4 +46,15 @@ impl Node {
Box::new(move |size| Ok(measure(size))),
))
}
+
+ /// Creates a new [`Node`] with the given [`Style`] and children.
+ ///
+ /// [`Node`]: struct.Node.html
+ /// [`Style`]: struct.Style.html
+ pub fn with_children(style: Style, children: Vec<Node>) -> Node {
+ Node(node::Node::new(
+ style.0,
+ children.iter().map(|c| &c.0).collect(),
+ ))
+ }
}