diff options
Diffstat (limited to 'src/systems/cmd')
| -rw-r--r-- | src/systems/cmd/macros.rs | 4 | ||||
| -rw-r--r-- | src/systems/cmd/processer.rs | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/systems/cmd/macros.rs b/src/systems/cmd/macros.rs index 9e2446b..0502a26 100644 --- a/src/systems/cmd/macros.rs +++ b/src/systems/cmd/macros.rs @@ -149,7 +149,7 @@ macro_rules! command_template { input: In, collect: Collect, ) -> Result< - crate::systems::cmd::cmd_system::AnyOutput, + $crate::systems::cmd::cmd_system::AnyOutput, $crate::systems::cmd::errors::CmdExecuteError, > { exec(input, collect).await @@ -188,7 +188,7 @@ macro_rules! cmd_output { macro_rules! early_cmd_output { ($t:ty => $v:expr) => {{ let checked_value: $t = $v; - Err(crate::systems::cmd::errors::CmdPrepareError::EarlyOutput(( + Err($crate::systems::cmd::errors::CmdPrepareError::EarlyOutput(( Box::new(checked_value) as Box<dyn std::any::Any + Send + 'static>, std::any::TypeId::of::<$t>(), ))) diff --git a/src/systems/cmd/processer.rs b/src/systems/cmd/processer.rs index aa494bb..2b66eef 100644 --- a/src/systems/cmd/processer.rs +++ b/src/systems/cmd/processer.rs @@ -8,7 +8,7 @@ use crate::systems::cmd::errors::CmdProcessError; use crate::systems::render::renderer::JVRenderResult; pub async fn jv_cmd_process( - args: &Vec<String>, + args: &[String], ctx: JVCommandContext, renderer_override: String, ) -> Result<JVRenderResult, CmdProcessError> { @@ -22,7 +22,7 @@ pub async fn jv_cmd_process( } async fn process( - args: &Vec<String>, + args: &[String], ctx: JVCommandContext, renderer_override: String, ) -> Result<JVRenderResult, CmdProcessError> { @@ -48,7 +48,7 @@ async fn process( 0 => { // No matching node found error!("{}", t!("verbose.cmd_match_no_node")); - return Err(CmdProcessError::NoMatchingCommand); + Err(CmdProcessError::NoMatchingCommand) } 1 => { let matched_prefix = matching_nodes[0]; @@ -60,7 +60,7 @@ async fn process( ); let prefix_len = matched_prefix.split_whitespace().count(); - let trimmed_args: Vec<String> = args.into_iter().cloned().skip(prefix_len).collect(); + let trimmed_args: Vec<String> = args.iter().skip(prefix_len).cloned().collect(); return jv_cmd_process_node(matched_prefix, trimmed_args, ctx, renderer_override).await; } _ => { @@ -84,7 +84,7 @@ async fn process( ); let prefix_len = matched_prefix.split_whitespace().count(); - let trimmed_args: Vec<String> = args.into_iter().cloned().skip(prefix_len).collect(); + let trimmed_args: Vec<String> = args.iter().skip(prefix_len).cloned().collect(); return jv_cmd_process_node(matched_prefix, trimmed_args, ctx, renderer_override).await; } } |
