developer_debug_tools

developer_debug_tools
The crate aids developers to their code e.g debug recurive function by printing the recursion tree of call
Annotate any recursive function with proc macro print_recursion_tree. Recursion tree is printed in the stdout
at the end of recursive call.
The pre condition is that all arguments and return type of the function must implement std::fmt::Debug trait
This macro depends on the below externa crates. Make sure to add it in your dependencies
use print_recursion_tree;
Output of fibonacci_recursive(3) is as below
fibonacci_recursive
└─ 3
├─ 2
│ ├─ 1
│ │ └─ =1
│ ├─ 0
│ │ └─ =0
│ └─ =1
├─ 1
│ └─ =1
└─ =2
fibonacci_recursive is the function name
└─3, └─2 denotes argument passed to the function
└─ =2, └─ =1 are the return value of each recursive call
Two flags(attributes) are supported by this proc-macro
1. print_each_pass
This prints the recursion tree on each recursive call. If this flag is not provided, recursion tree is printed only once at the end of the recursion
2.print_recursion_counter
This prints the total recursion calls evaluated. This can be useful to check the optimization of recursive call e.g using memoization
Total Number Of Recursions: 4