diff options
| author | mat <github@matdoes.dev> | 2022-01-11 00:01:47 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-01-11 00:01:47 -0600 |
| commit | cc4fe62fc82842e0bde628437a45d55c6a82f1f3 (patch) | |
| tree | 9248cb03406681f81d6d29a0878220fbe1e836e2 /azalea-brigadier/src/context/command_context.rs | |
| parent | 60b129b3a62b66dd389d1775892405fe735b9540 (diff) | |
| download | azalea-drasl-cc4fe62fc82842e0bde628437a45d55c6a82f1f3.tar.xz | |
adfsfasdfaSDQAWERTERYTUYghyubnjnrdfxcv etgvbhy0ujn-
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, |
