diff options
Diffstat (limited to 'azalea-brigadier/src/builder')
| -rw-r--r-- | azalea-brigadier/src/builder/argument_builder.rs | 2 | ||||
| -rw-r--r-- | azalea-brigadier/src/builder/required_argument_builder.rs | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/azalea-brigadier/src/builder/argument_builder.rs b/azalea-brigadier/src/builder/argument_builder.rs index dee6ccfe..14d41f4e 100644 --- a/azalea-brigadier/src/builder/argument_builder.rs +++ b/azalea-brigadier/src/builder/argument_builder.rs @@ -141,8 +141,8 @@ mod tests { use std::rc::Rc; use crate::{ + arguments::integer_argument_type::integer, builder::{literal_argument_builder::literal, required_argument_builder::argument}, - parsers::integer, }; use super::ArgumentBuilder; diff --git a/azalea-brigadier/src/builder/required_argument_builder.rs b/azalea-brigadier/src/builder/required_argument_builder.rs index a50f7ea9..9d4d9e0a 100644 --- a/azalea-brigadier/src/builder/required_argument_builder.rs +++ b/azalea-brigadier/src/builder/required_argument_builder.rs @@ -1,5 +1,7 @@ use super::argument_builder::{ArgumentBuilder, ArgumentBuilderType}; -use crate::{exceptions::CommandSyntaxException, parsers::Parser, string_reader::StringReader}; +use crate::{ + arguments::ArgumentType, exceptions::CommandSyntaxException, string_reader::StringReader, +}; use std::{any::Any, fmt::Debug, rc::Rc}; /// An argument node type. The `T` type parameter is the type of the argument, @@ -7,10 +9,10 @@ use std::{any::Any, fmt::Debug, rc::Rc}; #[derive(Clone)] pub struct Argument { pub name: String, - parser: Rc<dyn Parser>, + parser: Rc<dyn ArgumentType>, } impl Argument { - pub fn new(name: &str, parser: Rc<dyn Parser>) -> Self { + pub fn new(name: &str, parser: Rc<dyn ArgumentType>) -> Self { Self { name: name.to_string(), parser, @@ -38,6 +40,6 @@ impl Debug for Argument { } /// Shortcut for creating a new argument builder node. -pub fn argument<S>(name: &str, parser: impl Parser + 'static) -> ArgumentBuilder<S> { +pub fn argument<S>(name: &str, parser: impl ArgumentType + 'static) -> ArgumentBuilder<S> { ArgumentBuilder::new(Argument::new(name, Rc::new(parser)).into()) } |
