Are there any ways to recursively flatten tuples?
问题 In Rust, is there any way to use trait s and impl s to (recursively) flatten tuples? If it helps, something that works with N nested pairs is a good start trait FlattenTuple { fn into_flattened(self) -> /* ??? */ } // such that assert_eq!((1, (2, 3)).into_flattened(), (1, 2, 3)) It would be even better if it could be extended work with any kind of nested tuple such that: assert_eq!(((1, 2), 2, (3, (4, 5))).into_flattened(), (1, 2, 2, 3, 4, 5)) 回答1: Maybe for certain small definitions of