pub fn default_enumerator(children: &dyn Children, index: usize) -> String
Expand description
Default tree enumerator using standard box-drawing characters.
This enumerator generates the classic tree structure using Unicode box-drawing characters. Intermediate children get “├──” and the last child gets “└──” to properly terminate the branch.
§Arguments
children
- The children collection being enumeratedindex
- The zero-based index of the current child
§Returns
“├──” for intermediate children, “└──” for the last child
§Output Example
├── Foo
├── Bar
├── Baz
└── Qux
§Examples
use lipgloss_tree::{default_enumerator, new_string_data};
let children = new_string_data(&["Foo", "Bar", "Qux"]);
assert_eq!(default_enumerator(&children, 0), "├──"); // First child
assert_eq!(default_enumerator(&children, 1), "├──"); // Middle child
assert_eq!(default_enumerator(&children, 2), "└──"); // Last child