Skip to content

Commit 27d3c9e

Browse files
committed
Fix clippy::to_string_trait_impl
Signed-off-by: Christian König <[email protected]>
1 parent 99878e0 commit 27d3c9e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

core/src/mercury/types.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ impl From<MercuryError> for Error {
4949
}
5050
}
5151

52-
impl ToString for MercuryMethod {
53-
fn to_string(&self) -> String {
52+
impl std::fmt::Display for MercuryMethod {
53+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5454
match *self {
55-
MercuryMethod::Get => "GET",
56-
MercuryMethod::Sub => "SUB",
57-
MercuryMethod::Unsub => "UNSUB",
58-
MercuryMethod::Send => "SEND",
55+
MercuryMethod::Get => write!(f, "GET"),
56+
MercuryMethod::Sub => write!(f, "SUB"),
57+
MercuryMethod::Unsub => write!(f, "UNSUB"),
58+
MercuryMethod::Send => write!(f, "SEND"),
5959
}
60-
.to_owned()
6160
}
6261
}
6362

0 commit comments

Comments
 (0)