From 69f97dbf02e5422ee796492a3633a4e8f3f09d2d Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 31 Jul 2022 18:05:41 -0500 Subject: clippo the sequel --- azalea-brigadier/src/exceptions/command_syntax_exception.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'azalea-brigadier/src/exceptions') 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 } -- cgit v1.2.3