diff --git a/src/cli.rs b/src/cli.rs index fbd55fe..9097d0f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -64,7 +64,7 @@ //! starting the server. You can also use the `--bind` argument to specify the address to bind the //! server to, which defaults to `0.0.0.0:3000`. -use std::{net::SocketAddr, str::FromStr}; +use std::{fmt, net::SocketAddr, str::FromStr}; use twilight_gateway::ShardId; @@ -163,12 +163,13 @@ impl FromStr for Shard { } } -impl ToString for Shard { - fn to_string(&self) -> String { - format!("{}:{}", self.id, self.total) +impl fmt::Display for Shard { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}:{}", self.id, self.total) } } +#[allow(clippy::from_over_into)] impl Into for Shard { fn into(self) -> ShardId { ShardId::new(self.id, self.total)