diff options
| author | Ubuntu <github@matdoes.dev> | 2022-01-12 00:40:43 +0000 |
|---|---|---|
| committer | Ubuntu <github@matdoes.dev> | 2022-01-12 00:40:43 +0000 |
| commit | 270507736af57aae6801dc9eb3c3132139d0d07b (patch) | |
| tree | a8fa1d1b8d038eb9d7e2061342026d23ddbd9027 /azalea-brigadier/src/builder/argument_builder.rs | |
| parent | cc4fe62fc82842e0bde628437a45d55c6a82f1f3 (diff) | |
| download | azalea-drasl-270507736af57aae6801dc9eb3c3132139d0d07b.tar.xz | |
a
Diffstat (limited to 'azalea-brigadier/src/builder/argument_builder.rs')
| -rw-r--r-- | azalea-brigadier/src/builder/argument_builder.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/azalea-brigadier/src/builder/argument_builder.rs b/azalea-brigadier/src/builder/argument_builder.rs index bd2a2c15..0360b05a 100644 --- a/azalea-brigadier/src/builder/argument_builder.rs +++ b/azalea-brigadier/src/builder/argument_builder.rs @@ -1,4 +1,5 @@ use crate::{ + arguments::argument_type::{ArgumentType, Types}, command::Command, redirect_modifier::RedirectModifier, single_redirect_modifier::SingleRedirectModifier, @@ -8,7 +9,7 @@ use crate::{ pub struct BaseArgumentBuilder<'a, S, T> where S: Sized, - T: Sized, + T: Sized + ArgumentType<dyn Types>, { arguments: RootCommandNode<'a, S, T>, command: Option<&'a dyn Command<S, T>>, @@ -22,7 +23,10 @@ pub trait ArgumentBuilder<S, T> { fn build(self) -> dyn CommandNode<S, T>; } -impl<S, T> BaseArgumentBuilder<'_, S, T> { +impl<S, T> BaseArgumentBuilder<'_, S, T> +where + T: ArgumentType<dyn Types>, +{ pub fn then(&mut self, command: dyn CommandNode<S, T>) -> Result<&mut T, String> { if self.target.is_some() { return Err("Cannot add children to a redirected node".to_string()); |
