Fix clippy::to_string_trait_impl

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2024-05-11 19:53:55 +00:00
parent 99878e0f72
commit 27d3c9e92f
No known key found for this signature in database

View file

@ -49,15 +49,14 @@ impl From<MercuryError> for Error {
}
}
impl ToString for MercuryMethod {
fn to_string(&self) -> String {
impl std::fmt::Display for MercuryMethod {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match *self {
MercuryMethod::Get => "GET",
MercuryMethod::Sub => "SUB",
MercuryMethod::Unsub => "UNSUB",
MercuryMethod::Send => "SEND",
MercuryMethod::Get => write!(f, "GET"),
MercuryMethod::Sub => write!(f, "SUB"),
MercuryMethod::Unsub => write!(f, "UNSUB"),
MercuryMethod::Send => write!(f, "SEND"),
}
.to_owned()
}
}