mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +00:00
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:
parent
264dc37e50
commit
756f825521
1 changed files with 2 additions and 0 deletions
|
@ -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)]
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue