impl AsRef<str> for FlagReason
This commit is contained in:
parent
ab05893813
commit
8ad5d28e51
@ -20,6 +20,11 @@ pub enum FlagReason{
|
|||||||
}
|
}
|
||||||
impl ToString for FlagReason{
|
impl ToString for FlagReason{
|
||||||
fn to_string(&self)->String{
|
fn to_string(&self)->String{
|
||||||
|
self.as_ref().to_owned()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl AsRef<str> for FlagReason{
|
||||||
|
fn as_ref(&self)->&str{
|
||||||
match self{
|
match self{
|
||||||
FlagReason::Anticheat=>"Passed through anticheat zone.",
|
FlagReason::Anticheat=>"Passed through anticheat zone.",
|
||||||
FlagReason::StyleChange=>"Changed style.",
|
FlagReason::StyleChange=>"Changed style.",
|
||||||
@ -30,7 +35,7 @@ impl ToString for FlagReason{
|
|||||||
FlagReason::Timescale=>"Timescale is not allowed in this style.",
|
FlagReason::Timescale=>"Timescale is not allowed in this style.",
|
||||||
FlagReason::TimeTravel=>"Time travel is not allowed in this style.",
|
FlagReason::TimeTravel=>"Time travel is not allowed in this style.",
|
||||||
FlagReason::Teleport=>"Illegal teleport.",
|
FlagReason::Teleport=>"Illegal teleport.",
|
||||||
}.to_owned()
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user