From 270507736af57aae6801dc9eb3c3132139d0d07b Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 12 Jan 2022 00:40:43 +0000 Subject: a --- azalea-brigadier/src/tree/argument_command_node.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'azalea-brigadier/src/tree/argument_command_node.rs') diff --git a/azalea-brigadier/src/tree/argument_command_node.rs b/azalea-brigadier/src/tree/argument_command_node.rs index 647b6c35..3fc1bb50 100644 --- a/azalea-brigadier/src/tree/argument_command_node.rs +++ b/azalea-brigadier/src/tree/argument_command_node.rs @@ -21,6 +21,7 @@ use super::command_node::{BaseCommandNode, CommandNode}; const USAGE_ARGUMENT_OPEN: &str = "<"; const USAGE_ARGUMENT_CLOSE: &str = ">"; +#[derive(Clone)] pub struct ArgumentCommandNode<'a, S, T> where // each argument command node has its own different type @@ -34,7 +35,10 @@ where pub base: BaseCommandNode<'a, S, T>, } -impl ArgumentCommandNode<'_, S, T> { +impl ArgumentCommandNode<'_, S, T> +where + T: ArgumentType, +{ fn get_type(&self) -> &T { &self.type_ } @@ -44,7 +48,11 @@ impl ArgumentCommandNode<'_, S, T> { } } -impl<'a, S, T> CommandNode for ArgumentCommandNode<'a, S, T> { +impl<'a, S, T> CommandNode for ArgumentCommandNode<'a, S, T> +where + T: ArgumentType + Clone, + S: Clone, +{ fn name(&self) -> &str { &self.name } @@ -117,7 +125,10 @@ impl<'a, S, T> CommandNode for ArgumentCommandNode<'a, S, T> { } } -impl Display for ArgumentCommandNode<'_, (), (), ()> { +impl Display for ArgumentCommandNode<'_, S, T> +where + T: ArgumentType, +{ fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "", self.name, self.type_) } -- cgit v1.2.3