mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-04 04:01:33 +00:00
chore: Implement latest clippy warnings (#3220)
As I do frequently, I corrected for the latest clippy warnings. This will make sure the CI won't complain in the future. We could automate this btw and maybe run the nightly version of clippy.
This commit is contained in:
@ -44,13 +44,13 @@ pub enum Error<E> {
|
||||
impl<E: fmt::Display> fmt::Display for Error<E> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Error::Transport(err) => write!(f, "{}", err),
|
||||
Error::Tls(err) => write!(f, "{}", err),
|
||||
Error::Handshake(err) => write!(f, "{}", err),
|
||||
Error::InvalidMultiaddr(ma) => write!(f, "invalid multi-address: {}", ma),
|
||||
Error::Transport(err) => write!(f, "{err}"),
|
||||
Error::Tls(err) => write!(f, "{err}"),
|
||||
Error::Handshake(err) => write!(f, "{err}"),
|
||||
Error::InvalidMultiaddr(ma) => write!(f, "invalid multi-address: {ma}"),
|
||||
Error::TooManyRedirects => f.write_str("too many redirects"),
|
||||
Error::InvalidRedirectLocation => f.write_str("invalid redirect location"),
|
||||
Error::Base(err) => write!(f, "{}", err),
|
||||
Error::Base(err) => write!(f, "{err}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ where
|
||||
Ok(Either::Left(location))
|
||||
}
|
||||
handshake::ServerResponse::Rejected { status_code } => {
|
||||
let msg = format!("server rejected handshake; status code = {}", status_code);
|
||||
let msg = format!("server rejected handshake; status code = {status_code}");
|
||||
Err(Error::Handshake(msg.into()))
|
||||
}
|
||||
handshake::ServerResponse::Accepted { .. } => {
|
||||
@ -501,10 +501,10 @@ fn parse_ws_dial_addr<T>(addr: Multiaddr) -> Result<WsAddress, Error<T>> {
|
||||
let (host_port, dns_name) = loop {
|
||||
match (ip, tcp) {
|
||||
(Some(Protocol::Ip4(ip)), Some(Protocol::Tcp(port))) => {
|
||||
break (format!("{}:{}", ip, port), None)
|
||||
break (format!("{ip}:{port}"), None)
|
||||
}
|
||||
(Some(Protocol::Ip6(ip)), Some(Protocol::Tcp(port))) => {
|
||||
break (format!("{}:{}", ip, port), None)
|
||||
break (format!("{ip}:{port}"), None)
|
||||
}
|
||||
(Some(Protocol::Dns(h)), Some(Protocol::Tcp(port)))
|
||||
| (Some(Protocol::Dns4(h)), Some(Protocol::Tcp(port)))
|
||||
|
@ -167,9 +167,9 @@ pub enum Error {
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Error::Io(e) => write!(f, "i/o error: {}", e),
|
||||
Error::Tls(e) => write!(f, "tls error: {}", e),
|
||||
Error::InvalidDnsName(n) => write!(f, "invalid DNS name: {}", n),
|
||||
Error::Io(e) => write!(f, "i/o error: {e}"),
|
||||
Error::Tls(e) => write!(f, "tls error: {e}"),
|
||||
Error::InvalidDnsName(n) => write!(f, "invalid DNS name: {n}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user