aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/exceptions/command_syntax_exception.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/exceptions/command_syntax_exception.rs
parent10cd1733cbba5c637fa0130a0cd7a7ab6e618226 (diff)
downloadazalea-drasl-2e904225611b66fa72b082e4f5e188b55b333fcd.tar.xz
Fix clippy issues and add a couple tests to dispatcher
Diffstat (limited to 'azalea-brigadier/src/exceptions/command_syntax_exception.rs')
-rw-r--r--azalea-brigadier/src/exceptions/command_syntax_exception.rs9
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> {