1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
pub struct BTree<V> { pub node: TreeItem<V>, } pub enum TreeItem<V> { TreeLeaf { value: V }, } pub fn leaf<V>(value: V) -> TreeItem<V> { TreeItem::TreeLeaf { value: value } } fn main() { BTree::<isize> { node: leaf(1) }; }