From 27d00055df8691a6bd99aaf38633a7338b16cc6a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 11 Jul 2026 16:33:05 +0900 Subject: chore: use fully-qualified name for Rc/RefCell --- .../console/descriptor/application_description.rs | 36 +++++++++++++--------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/descriptor') diff --git a/crates/shirabe-external-packages/src/symfony/console/descriptor/application_description.rs b/crates/shirabe-external-packages/src/symfony/console/descriptor/application_description.rs index 33f6a8ec..63127266 100644 --- a/crates/shirabe-external-packages/src/symfony/console/descriptor/application_description.rs +++ b/crates/shirabe-external-packages/src/symfony/console/descriptor/application_description.rs @@ -5,13 +5,11 @@ use crate::symfony::console::command::command::Command; use crate::symfony::console::exception::command_not_found_exception::CommandNotFoundException; use indexmap::IndexMap; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; /// @internal #[derive(Debug)] pub struct ApplicationDescription { - application: Rc>, + application: std::rc::Rc>, namespace: Option, show_hidden: bool, @@ -20,17 +18,17 @@ pub struct ApplicationDescription { namespaces: Option>>, /// @var array - commands: Option>>>, + commands: Option>>>, /// @var array - aliases: Option>>>, + aliases: Option>>>, } impl ApplicationDescription { pub const GLOBAL_NAMESPACE: &'static str = "_global"; pub fn new( - application: Rc>, + application: std::rc::Rc>, namespace: Option, show_hidden: bool, ) -> Self { @@ -53,7 +51,9 @@ impl ApplicationDescription { } /// @return Command[] - pub fn get_commands(&mut self) -> &IndexMap>> { + pub fn get_commands( + &mut self, + ) -> &IndexMap>> { if self.commands.is_none() { self.inspect_application(); } @@ -62,7 +62,10 @@ impl ApplicationDescription { } /// @throws CommandNotFoundException - pub fn get_command(&self, name: &str) -> anyhow::Result>> { + pub fn get_command( + &self, + name: &str, + ) -> anyhow::Result>> { let in_commands = self .commands .as_ref() @@ -144,13 +147,18 @@ impl ApplicationDescription { fn sort_commands( &self, - commands: IndexMap>>, - ) -> IndexMap>>> { - let mut namespaced_commands: IndexMap>>> = - IndexMap::new(); - let mut global_commands: IndexMap>> = IndexMap::new(); - let mut sorted_commands: IndexMap>>> = + commands: IndexMap>>, + ) -> IndexMap>>> { + let mut namespaced_commands: IndexMap< + String, + IndexMap>>, + > = IndexMap::new(); + let mut global_commands: IndexMap>> = IndexMap::new(); + let mut sorted_commands: IndexMap< + String, + IndexMap>>, + > = IndexMap::new(); for (name, command) in commands { let key = self.application.borrow().extract_namespace(&name, Some(1)); if ["", Self::GLOBAL_NAMESPACE].contains(&key.as_str()) { -- cgit v1.3.1