Is it possible to unpack a tuple into function arguments?
问题 If I want to unpack a tuple and pass it as arguments is there a way to do this: //Does not compile fn main() { let tuple = (10, Vec::new()); foo(tuple); } fn foo(a: i32, b: Vec<i32>) { //Does stuff. } Instead of having to do this: fn main() { let tuple = (10, Vec::new()); foo(tuple.0, tuple.1); } fn foo(a: i32, b: Vec<i32>) { //Does stuff. } 回答1: On a nightly compiler: #![feature(fn_traits)] fn main() { let tuple = (10, Vec::new()); std::ops::Fn::call(&foo, tuple); } fn foo(a: i32, b: Vec<i32