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/tutorial_builder | |
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/tutorial_builder')
7 files changed, 10 insertions, 10 deletions
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 { |