aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/context.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-17 15:57:28 -0500
committermat <github@matdoes.dev>2022-04-17 15:57:28 -0500
commit2e904225611b66fa72b082e4f5e188b55b333fcd (patch)
tree5def0247b2a721ea20eded8ac996d957c591a403 /azalea-brigadier/src/context.rs
parent10cd1733cbba5c637fa0130a0cd7a7ab6e618226 (diff)
downloadazalea-drasl-2e904225611b66fa72b082e4f5e188b55b333fcd.tar.xz
Fix clippy issues and add a couple tests to dispatcher
Diffstat (limited to 'azalea-brigadier/src/context.rs')
-rw-r--r--azalea-brigadier/src/context.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-brigadier/src/context.rs b/azalea-brigadier/src/context.rs
index a68c1da5..5ffe2028 100644
--- a/azalea-brigadier/src/context.rs
+++ b/azalea-brigadier/src/context.rs
@@ -1,4 +1,4 @@
-use std::{any::Any, cell::RefCell, collections::HashMap, fmt::Debug, ptr, rc::Rc};
+use std::{any::Any, cell::RefCell, collections::HashMap, fmt::Debug, rc::Rc};
use crate::{
dispatcher::CommandDispatcher, modifier::RedirectModifier, string_range::StringRange,
@@ -73,7 +73,7 @@ impl<S: Any + Clone> CommandContextBuilder<S> {
nodes: self.nodes.clone(),
source: self.source.clone(),
command: self.command.clone(),
- child: self.child.clone().map(|c| Rc::new(c.build(&input))),
+ child: self.child.clone().map(|c| Rc::new(c.build(input))),
range: self.range.clone(),
forks: self.forks,
modifier: self.modifier.clone(),
@@ -125,7 +125,7 @@ impl<S: Any + Clone> CommandContext<S> {
if Rc::ptr_eq(&source, &self.source) {
return self.clone();
}
- return CommandContext {
+ CommandContext {
source,
input: self.input.clone(),
arguments: self.arguments.clone(),
@@ -136,11 +136,11 @@ impl<S: Any + Clone> CommandContext<S> {
child: self.child.clone(),
modifier: self.modifier.clone(),
forks: self.forks,
- };
+ }
}
pub fn has_nodes(&self) -> bool {
- return !self.nodes.is_empty();
+ !self.nodes.is_empty()
}
pub fn argument(&self, name: &str) -> Option<Rc<dyn Any>> {