[][src]Macro debug_tree::add_leaf_value_to

macro_rules! add_leaf_value_to {
    ($state:expr, $value:expr) => { ... };
}

Adds a leaf to given tree with the given value argument

Arguments

  • tree - The tree that the leaf should be added to
  • value - An expression that implements the Display trait.

Example

#[macro_use]
use debug_tree::{TreeBuilder, add_leaf_value_to};
fn main() {
    let tree = TreeBuilder::new();
    let value = add_leaf_value_to!(tree, 5 * 4 * 3 * 2);
    assert_eq!(120, value);
    assert_eq!("120", &tree.peek_string());
}