diff options
| author | mat <github@matdoes.dev> | 2022-07-31 18:05:41 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-07-31 18:05:41 -0500 |
| commit | 69f97dbf02e5422ee796492a3633a4e8f3f09d2d (patch) | |
| tree | 0727d5dd604e49135e2265690856c36ce28792e4 /azalea-brigadier/src/exceptions | |
| parent | 0cf8f82994db643e13ec90074bd1c2c92c6e67fb (diff) | |
| download | azalea-drasl-69f97dbf02e5422ee796492a3633a4e8f3f09d2d.tar.xz | |
clippo the sequel
Diffstat (limited to 'azalea-brigadier/src/exceptions')
| -rwxr-xr-x | azalea-brigadier/src/exceptions/command_syntax_exception.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/azalea-brigadier/src/exceptions/command_syntax_exception.rs b/azalea-brigadier/src/exceptions/command_syntax_exception.rs index 4bfe9cda..14376a87 100755 --- a/azalea-brigadier/src/exceptions/command_syntax_exception.rs +++ b/azalea-brigadier/src/exceptions/command_syntax_exception.rs @@ -1,7 +1,9 @@ -use std::{cmp, fmt}; - use super::builtin_exceptions::BuiltInExceptions; use crate::message::Message; +use std::{ + cmp, + fmt::{self, Write}, +}; #[derive(Clone, PartialEq)] pub struct CommandSyntaxException { @@ -36,11 +38,13 @@ impl CommandSyntaxException { let mut message = self.message.string(); let context = self.context(); if let Some(context) = context { - message.push_str(&format!( + write!( + message, " at position {}: {}", self.cursor.unwrap_or(usize::MAX), context - )); + ) + .unwrap(); } message } |
