Enumerating generic structs
问题 I wanted to try to build a proper implementation of Peano numbers using struct s, but it seems my generics game is not good enough yet and I could use some help. I read the docs on generics and some StackOverflow questions, but they don't fit my case. I introduced a Peano trait and Zero and Succ types: trait Peano {} struct Zero; struct Succ<T: Peano>(T); And implemented a Peano trait for both types to be able to abstract over both: impl Peano for Zero {} impl<T> Peano for Succ<T> where T: