Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Dec 21, 2022
1 parent 857da6d commit 0d44694
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ impl Socks5TcpHandler {

Err(Error::new(
ErrorKind::Other,
format!(
"Username/Password Authentication failed, user: {user_name}, password: {password}"
),
format!("Username/Password Authentication failed, user: {user_name}, password: {password}"),
))
}
}
Expand Down
20 changes: 4 additions & 16 deletions crates/shadowsocks/src/dns_resolver/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@ impl DnsResolver {
DnsResolver::System => match lookup_host((addr, port)).await {
Ok(v) => Ok(EitherResolved::Tokio(v)),
Err(err) => {
let err = Error::new(
ErrorKind::Other,
format!("dns resolve {addr}:{port} error: {err}"),
);
let err = Error::new(ErrorKind::Other, format!("dns resolve {addr}:{port} error: {err}"));
Err(err)
}
},
Expand All @@ -358,10 +355,7 @@ impl DnsResolver {
lookup_result.into_iter().map(move |ip| SocketAddr::new(ip, port)),
)),
Err(err) => {
let err = Error::new(
ErrorKind::Other,
format!("dns resolve {addr}:{port} error: {err}"),
);
let err = Error::new(ErrorKind::Other, format!("dns resolve {addr}:{port} error: {err}"));
Err(err)
}
},
Expand All @@ -371,20 +365,14 @@ impl DnsResolver {
lookup_result.into_iter().map(move |ip| SocketAddr::new(ip, port)),
)),
Err(err) => {
let err = Error::new(
ErrorKind::Other,
format!("dns resolve {addr}:{port} error: {err}"),
);
let err = Error::new(ErrorKind::Other, format!("dns resolve {addr}:{port} error: {err}"));
Err(err)
}
},
DnsResolver::Custom(ref resolver) => match resolver.resolve(addr, port).await {
Ok(v) => Ok(EitherResolved::Custom(v.into_iter())),
Err(err) => {
let err = Error::new(
ErrorKind::Other,
format!("dns resolve {addr}:{port} error: {err}"),
);
let err = Error::new(ErrorKind::Other, format!("dns resolve {addr}:{port} error: {err}"));
Err(err)
}
},
Expand Down
5 changes: 4 additions & 1 deletion crates/shadowsocks/src/relay/socks5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ use bytes::{Buf, BufMut, BytesMut};
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};

pub use self::consts::{
SOCKS5_AUTH_METHOD_GSSAPI, SOCKS5_AUTH_METHOD_NONE, SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE, SOCKS5_AUTH_METHOD_PASSWORD,
SOCKS5_AUTH_METHOD_GSSAPI,
SOCKS5_AUTH_METHOD_NONE,
SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE,
SOCKS5_AUTH_METHOD_PASSWORD,
};

#[rustfmt::skip]
Expand Down
6 changes: 5 additions & 1 deletion crates/shadowsocks/src/relay/udprelay/proxy_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ use crate::{
};

use super::crypto_io::{
decrypt_client_payload, decrypt_server_payload, encrypt_client_payload, encrypt_server_payload, ProtocolError,
decrypt_client_payload,
decrypt_server_payload,
encrypt_client_payload,
encrypt_server_payload,
ProtocolError,
ProtocolResult,
};

Expand Down

0 comments on commit 0d44694

Please sign in to comment.