let ps0 = expand(ps[0]);
let ps1 = expand(ps[1]);
println!("The product of {:?} and {:?} is {:?}",
ps0, ps1, product(ps0, ps1))
All variables are of type Vec<u8>.
The function product does NOT change its arguments, and the compiler should know that. Still, this does not compile. What do I do wrong?
Note : your call to product() will consume both of your vecs. You can't borrow them to println them because they are gone into product(). Maybe send a reference to the vecs to your product() function and change it's signature to accept two "& Vec"