I would like to pass the options of my CLI program via a Config
-struct that has ownership of its values, i.e. String
s of paths. The now deprecated ArgMatches::values_of_lossy()
returned an owned String
, however, ArgMatches::get_many()
only returns a ValuesRef<>
. What is the best way to get ownership of the argument itself, ideally without cloning?
ArgMatches::remove_many
will give you ownership, by moving those values out of the ArgMatches
struct.