Fix clippy warnings in cli module
This commit is contained in:
+5
-4
@@ -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<ShardId> for Shard {
|
||||
fn into(self) -> ShardId {
|
||||
ShardId::new(self.id, self.total)
|
||||
|
||||
Reference in New Issue
Block a user