From eb111be1f107696939b994f5de6e060cf972a732 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 13 Jan 2022 00:43:09 +0000 Subject: a --- azalea-brigadier/src/context/command_context.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'azalea-brigadier/src/context/command_context.rs') diff --git a/azalea-brigadier/src/context/command_context.rs b/azalea-brigadier/src/context/command_context.rs index 68144a40..4f0b4d49 100644 --- a/azalea-brigadier/src/context/command_context.rs +++ b/azalea-brigadier/src/context/command_context.rs @@ -6,22 +6,22 @@ use crate::{ arguments::argument_type::ArgumentType, command::Command, redirect_modifier::RedirectModifier, tree::command_node::CommandNode, }; -use std::collections::HashMap; +use std::{any::Any, collections::HashMap}; -pub struct CommandContext<'a, S, T> { +pub struct CommandContext<'a, S> { source: S, input: String, - command: &'a dyn Command, - arguments: HashMap>, - root_node: &'a dyn CommandNode, - nodes: Vec>, + command: &'a dyn Command, + arguments: HashMap>>, + root_node: &'a dyn CommandNode, + nodes: Vec>, range: StringRange, - child: Option<&'a CommandContext<'a, S, T>>, - modifier: Option<&'a dyn RedirectModifier>, + child: Option<&'a CommandContext<'a, S>>, + modifier: Option<&'a dyn RedirectModifier>, forks: bool, } -impl CommandContext<'_, S, T> +impl CommandContext<'_, S> where S: PartialEq, { @@ -43,11 +43,11 @@ where } } - fn child(&self) -> &Option> { + fn child(&self) -> &Option> { &self.child } - fn last_child(&self) -> &CommandContext { + fn last_child(&self) -> &CommandContext { let mut result = self; while result.child.is_some() { result = result.child.as_ref().unwrap(); @@ -55,7 +55,7 @@ where result } - fn command(&self) -> &dyn Command { + fn command(&self) -> &dyn Command { &self.command } -- cgit v1.2.3