diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/clap/examples | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/clap/examples')
-rw-r--r-- | vendor/clap/examples/cargo-example.rs | 2 | ||||
-rw-r--r-- | vendor/clap/examples/find.rs | 4 | ||||
-rw-r--r-- | vendor/clap/examples/git.rs | 2 | ||||
-rw-r--r-- | vendor/clap/examples/repl.rs | 2 | ||||
-rw-r--r-- | vendor/clap/examples/tutorial_builder/01_quick.rs | 2 | ||||
-rw-r--r-- | vendor/clap/examples/tutorial_builder/04_01_enum.rs | 2 | ||||
-rw-r--r-- | vendor/clap/examples/tutorial_builder/04_02_parse.rs | 2 | ||||
-rw-r--r-- | vendor/clap/examples/tutorial_builder/04_02_validate.rs | 4 | ||||
-rw-r--r-- | vendor/clap/examples/tutorial_builder/04_03_relations.rs | 4 | ||||
-rw-r--r-- | vendor/clap/examples/tutorial_builder/04_04_custom.rs | 4 | ||||
-rw-r--r-- | vendor/clap/examples/tutorial_builder/05_01_assert.rs | 2 |
11 files changed, 15 insertions, 15 deletions
diff --git a/vendor/clap/examples/cargo-example.rs b/vendor/clap/examples/cargo-example.rs index b0861a630..117336514 100644 --- a/vendor/clap/examples/cargo-example.rs +++ b/vendor/clap/examples/cargo-example.rs @@ -14,5 +14,5 @@ fn main() { _ => unreachable!("clap should ensure we don't get here"), }; let manifest_path = matches.get_one::<std::path::PathBuf>("manifest-path"); - println!("{:?}", manifest_path); + println!("{manifest_path:?}"); } diff --git a/vendor/clap/examples/find.rs b/vendor/clap/examples/find.rs index e073e702d..0b7f2c700 100644 --- a/vendor/clap/examples/find.rs +++ b/vendor/clap/examples/find.rs @@ -5,7 +5,7 @@ use clap::{arg, command, ArgGroup, ArgMatches, Command}; fn main() { let matches = cli().get_matches(); let values = Value::from_matches(&matches); - println!("{:#?}", values); + println!("{values:#?}"); } fn cli() -> Command { @@ -51,7 +51,7 @@ impl Value { if Self::extract::<bool>(matches, id, &mut values) { continue; } - unimplemented!("unknown type for {}: {:?}", id, matches); + unimplemented!("unknown type for {id}: {matches:?}"); } values.into_values().collect::<Vec<_>>() } diff --git a/vendor/clap/examples/git.rs b/vendor/clap/examples/git.rs index bd05e5315..02173675f 100644 --- a/vendor/clap/examples/git.rs +++ b/vendor/clap/examples/git.rs @@ -118,7 +118,7 @@ fn main() { println!("Pushing {message:?}"); } (name, _) => { - unreachable!("Unsupported subcommand `{}`", name) + unreachable!("Unsupported subcommand `{name}`") } } } diff --git a/vendor/clap/examples/repl.rs b/vendor/clap/examples/repl.rs index 2806ac8e9..d0baaed8d 100644 --- a/vendor/clap/examples/repl.rs +++ b/vendor/clap/examples/repl.rs @@ -41,7 +41,7 @@ fn respond(line: &str) -> Result<bool, String> { std::io::stdout().flush().map_err(|e| e.to_string())?; return Ok(true); } - Some((name, _matches)) => unimplemented!("{}", name), + Some((name, _matches)) => unimplemented!("{name}"), None => unreachable!("subcommand required"), } diff --git a/vendor/clap/examples/tutorial_builder/01_quick.rs b/vendor/clap/examples/tutorial_builder/01_quick.rs index 8126e335e..328ce5519 100644 --- a/vendor/clap/examples/tutorial_builder/01_quick.rs +++ b/vendor/clap/examples/tutorial_builder/01_quick.rs @@ -25,7 +25,7 @@ fn main() { // You can check the value provided by positional arguments, or option arguments if let Some(name) = matches.get_one::<String>("name") { - println!("Value for name: {}", name); + println!("Value for name: {name}"); } if let Some(config_path) = matches.get_one::<PathBuf>("config") { diff --git a/vendor/clap/examples/tutorial_builder/04_01_enum.rs b/vendor/clap/examples/tutorial_builder/04_01_enum.rs index 1afa018a1..aa9f41ce6 100644 --- a/vendor/clap/examples/tutorial_builder/04_01_enum.rs +++ b/vendor/clap/examples/tutorial_builder/04_01_enum.rs @@ -38,7 +38,7 @@ impl std::str::FromStr for Mode { return Ok(*variant); } } - Err(format!("invalid variant: {}", s)) + Err(format!("invalid variant: {s}")) } } diff --git a/vendor/clap/examples/tutorial_builder/04_02_parse.rs b/vendor/clap/examples/tutorial_builder/04_02_parse.rs index 13f41a18e..a3f79040d 100644 --- a/vendor/clap/examples/tutorial_builder/04_02_parse.rs +++ b/vendor/clap/examples/tutorial_builder/04_02_parse.rs @@ -13,5 +13,5 @@ fn main() { let port: u16 = *matches .get_one::<u16>("PORT") .expect("'PORT' is required and parsing will fail if its missing"); - println!("PORT = {}", port); + println!("PORT = {port}"); } diff --git a/vendor/clap/examples/tutorial_builder/04_02_validate.rs b/vendor/clap/examples/tutorial_builder/04_02_validate.rs index 4690e8e12..0ce53d654 100644 --- a/vendor/clap/examples/tutorial_builder/04_02_validate.rs +++ b/vendor/clap/examples/tutorial_builder/04_02_validate.rs @@ -15,7 +15,7 @@ fn main() { let port: u16 = *matches .get_one::<u16>("PORT") .expect("'PORT' is required and parsing will fail if its missing"); - println!("PORT = {}", port); + println!("PORT = {port}"); } const PORT_RANGE: RangeInclusive<usize> = 1..=65535; @@ -23,7 +23,7 @@ const PORT_RANGE: RangeInclusive<usize> = 1..=65535; fn port_in_range(s: &str) -> Result<u16, String> { let port: usize = s .parse() - .map_err(|_| format!("`{}` isn't a port number", s))?; + .map_err(|_| format!("`{s}` isn't a port number"))?; if PORT_RANGE.contains(&port) { Ok(port as u16) } else { diff --git a/vendor/clap/examples/tutorial_builder/04_03_relations.rs b/vendor/clap/examples/tutorial_builder/04_03_relations.rs index 9d2d3d8d9..935e7a334 100644 --- a/vendor/clap/examples/tutorial_builder/04_03_relations.rs +++ b/vendor/clap/examples/tutorial_builder/04_03_relations.rs @@ -58,10 +58,10 @@ fn main() { (_, _, true) => patch += 1, _ => unreachable!(), }; - format!("{}.{}.{}", major, minor, patch) + format!("{major}.{minor}.{patch}") }; - println!("Version: {}", version); + println!("Version: {version}"); // Check for usage of -c if matches.contains_id("config") { diff --git a/vendor/clap/examples/tutorial_builder/04_04_custom.rs b/vendor/clap/examples/tutorial_builder/04_04_custom.rs index ebbae67dc..840b3aa4f 100644 --- a/vendor/clap/examples/tutorial_builder/04_04_custom.rs +++ b/vendor/clap/examples/tutorial_builder/04_04_custom.rs @@ -57,10 +57,10 @@ fn main() { .exit(); } }; - format!("{}.{}.{}", major, minor, patch) + format!("{major}.{minor}.{patch}") }; - println!("Version: {}", version); + println!("Version: {version}"); // Check for usage of -c if matches.contains_id("config") { diff --git a/vendor/clap/examples/tutorial_builder/05_01_assert.rs b/vendor/clap/examples/tutorial_builder/05_01_assert.rs index 90c0a6383..b42c5762e 100644 --- a/vendor/clap/examples/tutorial_builder/05_01_assert.rs +++ b/vendor/clap/examples/tutorial_builder/05_01_assert.rs @@ -7,7 +7,7 @@ fn main() { let port: usize = *matches .get_one::<usize>("PORT") .expect("'PORT' is required and parsing will fail if its missing"); - println!("PORT = {}", port); + println!("PORT = {port}"); } fn cmd() -> clap::Command { |