I'm writing a command line tool that uses clap. One of the arguments takes two values which have different types (usize and f64). Right now my code looks like this:
let sphere: Vec<_> = matches.values_of("sphere").unwrap().collect(); let origin_id: usize = sphere.parse().unwrap(); let radius: f64 = sphere.parse().unwrap();
I am aware that clap provides a values_of_t method but that only seems to work if all values have the same type. My way works but it seems inelegant to me. Is there a more idiomatic way of doing it?