[−][src]Function parse_arg::match_arg
pub fn match_arg<T: ParseArg, S: AsRef<OsStr>, I>(
name: &str,
arg: S,
next: I
) -> Option<Result<T, ValueError<<T as ParseArg>::Error>>> where
I: IntoIterator,
I::Item: Arg,
Checks whether given arg matches the name
or begins with name=
and parses it
appropriately.
In case arg
is equal to name, the next argument is pulled from next
iterator and parsed using
the most efficient method.
In case arg
begins with name=
, it strips the name=
prefix and parses the rest.
Note: due to a limitation of std
, Windows implementation is slower than Unix one in name=
case. The difference is one-two allocations (depending on parsed type). This probably won't be
noticable for the user.