diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-24 04:51:47 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-24 05:02:54 +0900 |
| commit | a8623a5e867825400073d2597dfb3118d6624ef7 (patch) | |
| tree | 7df29f68596765dc3914209e14af4999b721815f /crates/shirabe-external-packages/src/symfony/console/helper/symfony_question_helper.rs | |
| parent | e87d37a294a4c754585309d391d793a2c9a1287e (diff) | |
| download | php-shirabe-a8623a5e867825400073d2597dfb3118d6624ef7.tar.gz php-shirabe-a8623a5e867825400073d2597dfb3118d6624ef7.tar.zst php-shirabe-a8623a5e867825400073d2597dfb3118d6624ef7.zip | |
chore: unwrap meaningless PhpMixed::String()
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/helper/symfony_question_helper.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/console/helper/symfony_question_helper.rs | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/symfony_question_helper.rs b/crates/shirabe-external-packages/src/symfony/console/helper/symfony_question_helper.rs index 9940896..ea7a322 100644 --- a/crates/shirabe-external-packages/src/symfony/console/helper/symfony_question_helper.rs +++ b/crates/shirabe-external-packages/src/symfony/console/helper/symfony_question_helper.rs @@ -32,27 +32,22 @@ impl SymfonyQuestionHelper { let default = question.get_default(); if question.is_multiline() { - text += &format!( - " (press {} to continue)", - PhpMixed::String(self.get_eof_shortcut()), - ); + text += &format!(" (press {} to continue)", self.get_eof_shortcut()); } // switch (true) if matches!(default, PhpMixed::Null) { - text = format!(" <info>{}</info>:", PhpMixed::String(text)); + text = format!(" <info>{}</info>:", text); } else if question.as_confirmation().is_some() { text = format!( " <info>{} (yes/no)</info> [<comment>{}</comment>]:", - PhpMixed::String(text), - PhpMixed::String( - if shirabe_php_shim::boolval(&default) { - "yes" - } else { - "no" - } - .to_string(), - ), + text, + if shirabe_php_shim::boolval(&default) { + "yes" + } else { + "no" + } + .to_string(), ); } else if let Some(choice_question) = question.as_choice().filter(|q| q.is_multiselect()) { let choices = choice_question.get_choices(); @@ -70,30 +65,28 @@ impl SymfonyQuestionHelper { text = format!( " <info>{}</info> [<comment>{}</comment>]:", - PhpMixed::String(text), - PhpMixed::String(OutputFormatter::escape(&resolved.join(", ")).unwrap()), + text, + OutputFormatter::escape(&resolved.join(", ")).unwrap(), ); } else if let Some(choice_question) = question.as_choice() { let choices = choice_question.get_choices(); text = format!( " <info>{}</info> [<comment>{}</comment>]:", - PhpMixed::String(text), - PhpMixed::String( - OutputFormatter::escape( - &choices - .get(&default.to_string()) - .cloned() - .unwrap_or(default.clone()) - .to_string(), - ) - .unwrap(), - ), + text, + OutputFormatter::escape( + &choices + .get(&default.to_string()) + .cloned() + .unwrap_or(default.clone()) + .to_string(), + ) + .unwrap(), ); } else { text = format!( " <info>{}</info> [<comment>{}</comment>]:", - PhpMixed::String(text), - PhpMixed::String(OutputFormatter::escape(&default.to_string()).unwrap()), + text, + OutputFormatter::escape(&default.to_string()).unwrap(), ); } |
