diff --git a/core/src/mercury/types.rs b/core/src/mercury/types.rs index 43b9c5cd..70fb3f86 100644 --- a/core/src/mercury/types.rs +++ b/core/src/mercury/types.rs @@ -51,12 +51,13 @@ impl From for Error { impl std::fmt::Display for MercuryMethod { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { - MercuryMethod::Get => write!(f, "GET"), - MercuryMethod::Sub => write!(f, "SUB"), - MercuryMethod::Unsub => write!(f, "UNSUB"), - MercuryMethod::Send => write!(f, "SEND"), - } + let s = match *self { + MercuryMethod::Get => "GET", + MercuryMethod::Sub => "SUB", + MercuryMethod::Unsub => "UNSUB", + MercuryMethod::Send => "SEND", + }; + write!(f, "{}", s) } }