fix: Point to public method on ArgMatches panic

This will make it faster for someone to figure out what is going on
without dropping down to `RUST_BACKTRRACE=1` by giving them the arg
*and* telling them which function *they* called was involved.
This commit is contained in:
Ed Page 2021-12-09 18:51:28 -06:00
parent 264dc37e50
commit 756f825521

View file

@ -987,6 +987,7 @@ impl ArgMatches {
// Private methods
impl ArgMatches {
#[inline]
#[cfg_attr(debug_assertions, track_caller)]
fn get_arg(&self, arg: &Id) -> Option<&MatchedArg> {
#[cfg(debug_assertions)]
{
@ -1010,6 +1011,7 @@ impl ArgMatches {
}
#[inline]
#[cfg_attr(debug_assertions, track_caller)]
fn get_subcommand(&self, id: &Id) -> Option<&SubCommand> {
#[cfg(debug_assertions)]
{