pub fn new_node(val: i32) -> Option<Rc<RefCell<TreeNode>>>
Expand description
Create a complete node(Option<Rc<RefCell<TreeNode>>>
) with given value.
This function is trivial. It only lets you avoid writing bunches of boiler plate code “::new(…)”.
§Examples
use leetcode_test_utils::tree::shortcuts::new_node;
let node = new_node(42);
assert_eq!(node.unwrap().borrow().val, 42);