diff options
Diffstat (limited to 'azalea-brigadier/src/context/command_context.rs')
| -rw-r--r-- | azalea-brigadier/src/context/command_context.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/azalea-brigadier/src/context/command_context.rs b/azalea-brigadier/src/context/command_context.rs index 36741906..68144a40 100644 --- a/azalea-brigadier/src/context/command_context.rs +++ b/azalea-brigadier/src/context/command_context.rs @@ -14,17 +14,20 @@ pub struct CommandContext<'a, S, T> { command: &'a dyn Command<S, T>, arguments: HashMap<String, ParsedArgument<T>>, root_node: &'a dyn CommandNode<S, T>, - nodes: Vec<ParsedCommandNode<'a, S, T>>, + nodes: Vec<ParsedCommandNode<S, T>>, range: StringRange, - child: Option<CommandContext<'a, S, T>>, + child: Option<&'a CommandContext<'a, S, T>>, modifier: Option<&'a dyn RedirectModifier<S, T>>, forks: bool, } -impl<S, T> CommandContext<'_, S, T> { +impl<S, T> CommandContext<'_, S, T> +where + S: PartialEq, +{ pub fn clone_for(&self, source: S) -> Self { if self.source == source { - return self.clone(); + return *self; } Self { source, |
