From 8ad5d28e5111f64a596554412f12d011405e1d29 Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Tue, 7 Jan 2025 23:57:22 -0800
Subject: [PATCH] impl AsRef<str> for FlagReason

---
 lib/common/src/run.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/common/src/run.rs b/lib/common/src/run.rs
index cac44a171..8ab499ce1 100644
--- a/lib/common/src/run.rs
+++ b/lib/common/src/run.rs
@@ -20,6 +20,11 @@ pub enum FlagReason{
 }
 impl ToString for FlagReason{
 	fn to_string(&self)->String{
+		self.as_ref().to_owned()
+	}
+}
+impl AsRef<str> for FlagReason{
+	fn as_ref(&self)->&str{
 		match self{
 			FlagReason::Anticheat=>"Passed through anticheat zone.",
 			FlagReason::StyleChange=>"Changed style.",
@@ -30,7 +35,7 @@ impl ToString for FlagReason{
 			FlagReason::Timescale=>"Timescale is not allowed in this style.",
 			FlagReason::TimeTravel=>"Time travel is not allowed in this style.",
 			FlagReason::Teleport=>"Illegal teleport.",
-		}.to_owned()
+		}
 	}
 }