diff options
Diffstat (limited to 'azalea-brigadier/src/exceptions')
| -rwxr-xr-x | azalea-brigadier/src/exceptions/builtin_exceptions.rs | 6 | ||||
| -rwxr-xr-x | azalea-brigadier/src/exceptions/command_syntax_exception.rs | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/azalea-brigadier/src/exceptions/builtin_exceptions.rs b/azalea-brigadier/src/exceptions/builtin_exceptions.rs index d95ee237..c3c3c900 100755 --- a/azalea-brigadier/src/exceptions/builtin_exceptions.rs +++ b/azalea-brigadier/src/exceptions/builtin_exceptions.rs @@ -1,6 +1,6 @@ use std::fmt; -use crate::{message::Message, string_reader::StringReader}; +use crate::string_reader::StringReader; use super::command_syntax_exception::CommandSyntaxException; @@ -148,12 +148,12 @@ impl fmt::Debug for BuiltInExceptions { impl BuiltInExceptions { pub fn create(self) -> CommandSyntaxException { - let message = Message::from(format!("{self:?}")); + let message = format!("{self:?}"); CommandSyntaxException::create(self, message) } pub fn create_with_context(self, reader: &StringReader) -> CommandSyntaxException { - let message = Message::from(format!("{self:?}")); + let message = format!("{self:?}"); CommandSyntaxException::new(self, message, reader.string(), reader.cursor()) } } diff --git a/azalea-brigadier/src/exceptions/command_syntax_exception.rs b/azalea-brigadier/src/exceptions/command_syntax_exception.rs index 14376a87..0254820d 100755 --- a/azalea-brigadier/src/exceptions/command_syntax_exception.rs +++ b/azalea-brigadier/src/exceptions/command_syntax_exception.rs @@ -1,5 +1,4 @@ use super::builtin_exceptions::BuiltInExceptions; -use crate::message::Message; use std::{ cmp, fmt::{self, Write}, @@ -8,7 +7,7 @@ use std::{ #[derive(Clone, PartialEq)] pub struct CommandSyntaxException { pub type_: BuiltInExceptions, - message: Message, + message: String, input: Option<String>, cursor: Option<usize>, } @@ -16,7 +15,7 @@ pub struct CommandSyntaxException { const CONTEXT_AMOUNT: usize = 10; impl CommandSyntaxException { - pub fn new(type_: BuiltInExceptions, message: Message, input: &str, cursor: usize) -> Self { + pub fn new(type_: BuiltInExceptions, message: String, input: &str, cursor: usize) -> Self { Self { type_, message, @@ -25,7 +24,7 @@ impl CommandSyntaxException { } } - pub fn create(type_: BuiltInExceptions, message: Message) -> Self { + pub fn create(type_: BuiltInExceptions, message: String) -> Self { Self { type_, message, @@ -35,7 +34,7 @@ impl CommandSyntaxException { } pub fn message(&self) -> String { - let mut message = self.message.string(); + let mut message = self.message.clone(); let context = self.context(); if let Some(context) = context { write!( @@ -49,7 +48,7 @@ impl CommandSyntaxException { message } - pub fn raw_message(&self) -> &Message { + pub fn raw_message(&self) -> &String { &self.message } |
