diff options
| author | mat <github@matdoes.dev> | 2022-04-17 15:57:28 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-17 15:57:28 -0500 |
| commit | 2e904225611b66fa72b082e4f5e188b55b333fcd (patch) | |
| tree | 5def0247b2a721ea20eded8ac996d957c591a403 /azalea-brigadier/src/exceptions | |
| parent | 10cd1733cbba5c637fa0130a0cd7a7ab6e618226 (diff) | |
| download | azalea-drasl-2e904225611b66fa72b082e4f5e188b55b333fcd.tar.xz | |
Fix clippy issues and add a couple tests to dispatcher
Diffstat (limited to 'azalea-brigadier/src/exceptions')
| -rw-r--r-- | azalea-brigadier/src/exceptions/command_syntax_exception.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/azalea-brigadier/src/exceptions/command_syntax_exception.rs b/azalea-brigadier/src/exceptions/command_syntax_exception.rs index 6cd4e53d..93ac788c 100644 --- a/azalea-brigadier/src/exceptions/command_syntax_exception.rs +++ b/azalea-brigadier/src/exceptions/command_syntax_exception.rs @@ -1,9 +1,9 @@ -use std::{cmp, fmt, rc::Rc}; +use std::{cmp, fmt}; use super::builtin_exceptions::BuiltInExceptions; use crate::message::Message; -#[derive(Clone)] +#[derive(Clone, PartialEq)] pub struct CommandSyntaxException { type_: BuiltInExceptions, message: Message, @@ -12,7 +12,6 @@ pub struct CommandSyntaxException { } const CONTEXT_AMOUNT: usize = 10; -const ENABLE_COMMAND_STACK_TRACES: bool = true; impl CommandSyntaxException { pub fn new(type_: BuiltInExceptions, message: Message, input: &str, cursor: usize) -> Self { @@ -76,8 +75,8 @@ impl CommandSyntaxException { &self.type_ } - pub fn input(&self) -> String { - self.input() + pub fn input(&self) -> &Option<String> { + &self.input } pub fn cursor(&self) -> Option<usize> { |
