summaryrefslogtreecommitdiffstats
path: root/vendor/clap/examples/derive_ref/flatten_hand_args.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
commit246f239d9f40f633160f0c18f87a20922d4e77bb (patch)
tree5a88572663584b3d4d28e5a20e10abab1be40884 /vendor/clap/examples/derive_ref/flatten_hand_args.rs
parentReleasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz
rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--vendor/clap/examples/derive_ref/flatten_hand_args.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/vendor/clap/examples/derive_ref/flatten_hand_args.rs b/vendor/clap/examples/derive_ref/flatten_hand_args.rs
index 74d10edec..c10e0b29f 100644
--- a/vendor/clap/examples/derive_ref/flatten_hand_args.rs
+++ b/vendor/clap/examples/derive_ref/flatten_hand_args.rs
@@ -15,8 +15,8 @@ impl FromArgMatches for CliArgs {
}
fn from_arg_matches_mut(matches: &mut ArgMatches) -> Result<Self, Error> {
Ok(Self {
- foo: *matches.get_one::<bool>("foo").expect("defaulted by clap"),
- bar: *matches.get_one::<bool>("bar").expect("defaulted by clap"),
+ foo: matches.get_flag("foo"),
+ bar: matches.get_flag("bar"),
quuz: matches.remove_one::<String>("quuz"),
})
}
@@ -25,8 +25,8 @@ impl FromArgMatches for CliArgs {
self.update_from_arg_matches_mut(&mut matches)
}
fn update_from_arg_matches_mut(&mut self, matches: &mut ArgMatches) -> Result<(), Error> {
- self.foo |= *matches.get_one::<bool>("foo").expect("defaulted by clap");
- self.bar |= *matches.get_one::<bool>("bar").expect("defaulted by clap");
+ self.foo |= matches.get_flag("foo");
+ self.bar |= matches.get_flag("bar");
if let Some(quuz) = matches.remove_one::<String>("quuz") {
self.quuz = Some(quuz);
}