Use of children count and simple error handling
This commit is contained in:
parent
c3b04be872
commit
5c99e80670
2 changed files with 30 additions and 4 deletions
|
|
@ -12,10 +12,15 @@ pub struct Node {
|
|||
}
|
||||
|
||||
impl Node {
|
||||
pub fn new(children: Option<Vec<Node>>, handler: NodeHandler) -> Self {
|
||||
pub fn new(
|
||||
children: Option<Vec<Node>>,
|
||||
handler: NodeHandler,
|
||||
max_children_count: Option<usize>,
|
||||
) -> Self {
|
||||
Self {
|
||||
children: children.unwrap_or(vec![]),
|
||||
handler: handler,
|
||||
max_children_count,
|
||||
}
|
||||
}
|
||||
pub fn get_value(&self) -> f64 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue