A function I want to use requires a Vec<String>
as parameter input.
What I have instead is either a string slice (&str
) or a String
.
My attempt:
let options_vec: Vec<String> = options.split(char::is_withespace).collect::<Vec<_>>();
The error I'm getting is:
value of type `std::vec::Vec<std::string::String>` cannot be built from `std::iter::Iterator<Item=&str>