diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-27 03:52:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-27 04:21:34 +0900 |
| commit | 2b51554ff59d1e5cbf8dd2db65d278b0202a9102 (patch) | |
| tree | f4d9b0abf4df9b5e363e3bd65511d70e3d5ada00 /crates/shirabe-external-packages/src/symfony/console/input/input_definition.rs | |
| parent | cc07b5abb83a40d678401c335bdc49bb81b72c5f (diff) | |
| download | php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.tar.gz php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.tar.zst php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.zip | |
refactor: fix compiler warnings and clippy warnings
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/input/input_definition.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/console/input/input_definition.rs | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_definition.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_definition.rs index 56f685c..a1d3d30 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/input_definition.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_definition.rs @@ -114,7 +114,7 @@ impl InputDefinition { return Err(LogicException(shirabe_php_shim::LogicException { message: format!( "An argument with name \"{}\" already exists.", - argument.get_name().to_string(), + argument.get_name(), ), code: 0, }) @@ -125,8 +125,8 @@ impl InputDefinition { return Err(LogicException(shirabe_php_shim::LogicException { message: format!( "Cannot add a required argument \"{}\" after an array argument \"{}\".", - argument.get_name().to_string(), - last_array_argument.get_name().to_string(), + argument.get_name(), + last_array_argument.get_name(), ), code: 0, }) @@ -139,8 +139,8 @@ impl InputDefinition { return Err(LogicException(shirabe_php_shim::LogicException { message: format!( "Cannot add a required argument \"{}\" after an optional one \"{}\".", - argument.get_name().to_string(), - last_optional_argument.get_name().to_string(), + argument.get_name(), + last_optional_argument.get_name(), ), code: 0, }) @@ -260,20 +260,14 @@ impl InputDefinition { && !option.equals(existing) { return Err(LogicException(shirabe_php_shim::LogicException { - message: format!( - "An option named \"{}\" already exists.", - option.get_name().to_string(), - ), + message: format!("An option named \"{}\" already exists.", option.get_name(),), code: 0, }) .into()); } if self.negations.contains_key(option.get_name()) { return Err(LogicException(shirabe_php_shim::LogicException { - message: format!( - "An option named \"{}\" already exists.", - option.get_name().to_string(), - ), + message: format!("An option named \"{}\" already exists.", option.get_name(),), code: 0, }) .into()); @@ -329,7 +323,7 @@ impl InputDefinition { if !self.has_option(name) { return Err( InvalidArgumentException(shirabe_php_shim::InvalidArgumentException { - message: format!("The \"--{}\" option does not exist.", name.to_string()), + message: format!("The \"--{}\" option does not exist.", name), code: 0, }) .into(), @@ -381,7 +375,7 @@ impl InputDefinition { match self.shortcuts.get(shortcut) { None => Err( InvalidArgumentException(shirabe_php_shim::InvalidArgumentException { - message: format!("The \"-{}\" option does not exist.", shortcut.to_string()), + message: format!("The \"-{}\" option does not exist.", shortcut), code: 0, }) .into(), @@ -395,7 +389,7 @@ impl InputDefinition { match self.negations.get(negation) { None => Err( InvalidArgumentException(shirabe_php_shim::InvalidArgumentException { - message: format!("The \"--{}\" option does not exist.", negation.to_string()), + message: format!("The \"--{}\" option does not exist.", negation), code: 0, }) .into(), @@ -432,19 +426,19 @@ impl InputDefinition { let shortcut = match option.get_shortcut() { Some(shortcut) => { - format!("-{}|", shortcut.to_string()) + format!("-{}|", shortcut) } None => String::new(), }; let negation = if option.is_negatable() { - format!("|--no-{}", option.get_name().to_string()) + format!("|--no-{}", option.get_name()) } else { String::new() }; elements.push(format!( "[{}--{}{}{}]", shortcut, - option.get_name().to_string(), + option.get_name(), value, negation, )); |
