diff options
| author | mat <github@matdoes.dev> | 2022-04-18 19:38:08 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-18 19:38:08 -0500 |
| commit | b8ceb56e7141320d5ba23a946fe3eceee43f51f5 (patch) | |
| tree | 6cabb2ec6b47a0f6da26919869f839c1aa343978 /azalea-brigadier/src/builder | |
| parent | 8d71fbf813391783531a9f7c70e75e105fabaf03 (diff) | |
| download | azalea-drasl-b8ceb56e7141320d5ba23a946fe3eceee43f51f5.tar.xz | |
move `parsers` into `arguments`
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()) } |
