aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/tree/root_command_node.rs
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2022-01-13 00:43:09 +0000
committerUbuntu <github@matdoes.dev>2022-01-13 00:43:09 +0000
commiteb111be1f107696939b994f5de6e060cf972a732 (patch)
tree055deab4179088c5e91a179bfe465a7859c45ab6 /azalea-brigadier/src/tree/root_command_node.rs
parent270507736af57aae6801dc9eb3c3132139d0d07b (diff)
downloadazalea-drasl-eb111be1f107696939b994f5de6e060cf972a732.tar.xz
a
Diffstat (limited to 'azalea-brigadier/src/tree/root_command_node.rs')
-rw-r--r--azalea-brigadier/src/tree/root_command_node.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/azalea-brigadier/src/tree/root_command_node.rs b/azalea-brigadier/src/tree/root_command_node.rs
index ded5fa77..c3139a05 100644
--- a/azalea-brigadier/src/tree/root_command_node.rs
+++ b/azalea-brigadier/src/tree/root_command_node.rs
@@ -1,7 +1,7 @@
use std::fmt::{Display, Formatter};
use crate::{
- arguments::argument_type::{ArgumentType, Types},
+ arguments::argument_type::ArgumentType,
context::{command_context::CommandContext, command_context_builder::CommandContextBuilder},
exceptions::{
builtin_exceptions::BuiltInExceptions, command_syntax_exception::CommandSyntaxException,
@@ -13,18 +13,13 @@ use crate::{
use super::command_node::{BaseCommandNode, CommandNode};
#[derive(Clone, Default)]
-pub struct RootCommandNode<'a, S, T>
-where
- // each argument command node has its own different type
- T: ArgumentType<dyn Types>,
-{
+pub struct RootCommandNode<'a, S> {
// Since Rust doesn't have extending, we put the struct this is extending as the "base" field
- pub base: BaseCommandNode<'a, S, T>,
+ pub base: BaseCommandNode<'a, S>,
}
-impl<S, T> CommandNode<S, T> for RootCommandNode<'_, S, T>
+impl<S> CommandNode<S> for RootCommandNode<'_, S>
where
- T: ArgumentType<dyn Types> + Clone,
S: Clone,
{
fn name(&self) -> &str {
@@ -34,13 +29,13 @@ where
fn parse(
&self,
reader: StringReader,
- context_builder: CommandContextBuilder<S, T>,
+ context_builder: CommandContextBuilder<S>,
) -> Result<(), CommandSyntaxException> {
}
fn list_suggestions(
&self,
- context: CommandContext<S, T>,
+ context: CommandContext<S>,
builder: SuggestionsBuilder,
) -> Result<Suggestions, CommandSyntaxException> {
Suggestions::empty()
@@ -63,10 +58,7 @@ where
}
}
-impl<S, T> Display for RootCommandNode<'_, S, T>
-where
- T: ArgumentType<dyn Types>,
-{
+impl<S> Display for RootCommandNode<'_, S> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "<root>")
}