&Path with values_t #2013
-
Is there a way to have let vals: Vec<&Path>;
if let Some(load_paths) = matches.values_of("LOAD_PATH") {
vals = load_paths.map(|p| Path::new(p)).collect();
} else {
vals = Vec::new();
} |
Beta Was this translation helpful? Give feedback.
Answered by
CreepySkeleton
Jul 15, 2020
Replies: 1 comment 2 replies
-
No. It uses
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
pickfire
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No. It uses
FromStr
, which implies a reallocation, and your rationale was to avoid an extra allocation.values_t
will be replaced withArgMatches::values_of_t
by the way.