我刚开始做tutorial in Rust,我无法理解元组打印的局限性:
fn main() {
// Tuple definition
let short = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
let long = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
println!("{:?}", short); // Works fine
println!("{:?}", long); // ({integer}...{integer})` cannot be formatted using `:?` because it doesn't implement `std::fmt::Debug`
}
在我看来,通过对整个元组进行迭代,可以很容易地实现打印——这将允许在不受大小限制的情况下进行显示.如果解决方案是那么简单,那么它就会被实现,我在这里缺少什么?