From c344edf8b9df19b1268f2ed8aa5c455c8d0ac31e Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 19 Sep 2023 12:38:21 -0500 Subject: [PATCH] docs: Clarify most asserts are for debug builds --- clap_builder/src/builder/arg.rs | 2 +- clap_builder/src/builder/command.rs | 13 +++++++------ clap_builder/src/builder/range.rs | 2 +- clap_builder/src/parser/matches/arg_matches.rs | 12 ++++++------ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/clap_builder/src/builder/arg.rs b/clap_builder/src/builder/arg.rs index d067dec1..5634078c 100644 --- a/clap_builder/src/builder/arg.rs +++ b/clap_builder/src/builder/arg.rs @@ -470,7 +470,7 @@ impl Arg { /// /// [`Command`] will [`panic!`] if indexes are skipped (such as defining `index(1)` and `index(3)` /// but not `index(2)`, or a positional argument is defined as multiple and is not the highest - /// index + /// index (debug builds) /// /// # Examples /// diff --git a/clap_builder/src/builder/command.rs b/clap_builder/src/builder/command.rs index 17194194..b1623cf8 100644 --- a/clap_builder/src/builder/command.rs +++ b/clap_builder/src/builder/command.rs @@ -553,7 +553,7 @@ impl Command { /// /// # Panics /// - /// If contradictory arguments or settings exist. + /// If contradictory arguments or settings exist (debug builds). /// /// # Examples /// @@ -577,7 +577,7 @@ impl Command { /// /// # Panics /// - /// If contradictory arguments or settings exist. + /// If contradictory arguments or settings exist (debug builds). /// /// # Examples /// @@ -605,7 +605,7 @@ impl Command { /// /// # Panics /// - /// If contradictory arguments or settings exist. + /// If contradictory arguments or settings exist (debug builds). /// /// # Examples /// @@ -638,7 +638,7 @@ impl Command { /// /// # Panics /// - /// If contradictory arguments or settings exist. + /// If contradictory arguments or settings exist (debug builds). /// /// # Examples /// @@ -677,7 +677,7 @@ impl Command { /// /// # Panics /// - /// If contradictory arguments or settings exist. + /// If contradictory arguments or settings exist (debug builds). /// /// # Examples /// @@ -723,7 +723,7 @@ impl Command { /// /// # Panics /// - /// If contradictory arguments or settings exist. + /// If contradictory arguments or settings exist (debug builds). /// /// # Examples /// @@ -1414,6 +1414,7 @@ impl Command { /// /// # Panics /// + /// On debug builds: /// ```rust,no_run /// # use clap_builder as clap; /// # use clap::{Command, Arg}; diff --git a/clap_builder/src/builder/range.rs b/clap_builder/src/builder/range.rs index a4039154..158d02cc 100644 --- a/clap_builder/src/builder/range.rs +++ b/clap_builder/src/builder/range.rs @@ -22,7 +22,7 @@ impl ValueRange { /// /// # Panics /// - /// If the end is less than the start + /// If the end is less than the start (debug builds) /// /// # Examples /// diff --git a/clap_builder/src/parser/matches/arg_matches.rs b/clap_builder/src/parser/matches/arg_matches.rs index 52590429..8390b0b5 100644 --- a/clap_builder/src/parser/matches/arg_matches.rs +++ b/clap_builder/src/parser/matches/arg_matches.rs @@ -237,7 +237,7 @@ impl ArgMatches { /// /// # Panics /// - /// If the argument definition and access mismatch. To handle this case programmatically, see + /// If the argument definition and access mismatch (debug builds). To handle this case programmatically, see /// [`ArgMatches::try_get_occurrences`]. /// /// # Examples @@ -490,7 +490,7 @@ impl ArgMatches { /// /// # Panics /// - /// If `id` is not a valid argument or group name. To handle this case programmatically, see + /// If `id` is not a valid argument or group name (debug builds). To handle this case programmatically, see /// [`ArgMatches::try_contains_id`]. /// /// # Examples @@ -570,7 +570,7 @@ impl ArgMatches { /// /// # Panics /// - /// If `id` is not a valid argument or group id. + /// If `id` is not a valid argument or group id (debug builds). /// /// # Examples /// @@ -617,7 +617,7 @@ impl ArgMatches { /// /// # Panics /// - /// If `id` is not a valid argument or group id. + /// If `id` is not a valid argument or group id (debug builds). /// /// # Examples /// @@ -765,7 +765,7 @@ impl ArgMatches { /// /// # Panics /// - /// If `id` is not a valid argument or group id. + /// If `id` is not a valid argument or group id (debug builds). /// /// # Examples /// @@ -969,7 +969,7 @@ impl ArgMatches { /// /// # Panics /// - /// If `id` is not a valid subcommand. + /// If `id` is not a valid subcommand (debug builds). /// /// # Examples ///