We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99878e0 commit 27d3c9eCopy full SHA for 27d3c9e
1 file changed
core/src/mercury/types.rs
@@ -49,15 +49,14 @@ impl From<MercuryError> for Error {
49
}
50
51
52
-impl ToString for MercuryMethod {
53
- fn to_string(&self) -> String {
+impl std::fmt::Display for MercuryMethod {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
54
match *self {
55
- MercuryMethod::Get => "GET",
56
- MercuryMethod::Sub => "SUB",
57
- MercuryMethod::Unsub => "UNSUB",
58
- MercuryMethod::Send => "SEND",
+ MercuryMethod::Get => write!(f, "GET"),
+ MercuryMethod::Sub => write!(f, "SUB"),
+ MercuryMethod::Unsub => write!(f, "UNSUB"),
+ MercuryMethod::Send => write!(f, "SEND"),
59
60
- .to_owned()
61
62
63
0 commit comments