From 2e904225611b66fa72b082e4f5e188b55b333fcd Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 17 Apr 2022 15:57:28 -0500 Subject: Fix clippy issues and add a couple tests to dispatcher --- azalea-brigadier/src/context.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'azalea-brigadier/src/context.rs') 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 CommandContextBuilder { 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 CommandContext { 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 CommandContext { 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> { -- cgit v1.2.3