mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-18 16:16:52 +00:00
Fix uninlined format args
This commit is contained in:
@@ -118,7 +118,7 @@ impl ProxyHttpStream {
|
||||
Err(_) => {
|
||||
return Err(io::Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("invalid dnsname \"{}\"", domain),
|
||||
format!("invalid dnsname \"{domain}\""),
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -108,7 +108,7 @@ impl fmt::Display for ResultCode {
|
||||
ResultCode::RequestRejectedDifferentUserId => {
|
||||
f.write_str("request rejected because the client program and identd report different user-ids")
|
||||
}
|
||||
ResultCode::Other(code) => write!(f, "other result code {}", code),
|
||||
ResultCode::Other(code) => write!(f, "other result code {code}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,8 +126,8 @@ impl fmt::Debug for Address {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Address::SocketAddress(ref addr) => write!(f, "{}", addr),
|
||||
Address::DomainNameAddress(ref addr, ref port) => write!(f, "{}:{}", addr, port),
|
||||
Address::SocketAddress(ref addr) => write!(f, "{addr}"),
|
||||
Address::DomainNameAddress(ref addr, ref port) => write!(f, "{addr}:{port}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,8 +136,8 @@ impl fmt::Display for Address {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Address::SocketAddress(ref addr) => write!(f, "{}", addr),
|
||||
Address::DomainNameAddress(ref addr, ref port) => write!(f, "{}:{}", addr, port),
|
||||
Address::SocketAddress(ref addr) => write!(f, "{addr}"),
|
||||
Address::DomainNameAddress(ref addr, ref port) => write!(f, "{addr}:{port}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ impl Manager {
|
||||
|
||||
#[cfg(unix)]
|
||||
fn server_pid_path(&self, port: u16) -> PathBuf {
|
||||
let pid_file_name = format!("shadowsocks-server-{}.pid", port);
|
||||
let pid_file_name = format!("shadowsocks-server-{port}.pid");
|
||||
let mut pid_path = self.svr_cfg.server_working_directory.clone();
|
||||
pid_path.push(&pid_file_name);
|
||||
pid_path
|
||||
@@ -337,7 +337,7 @@ impl Manager {
|
||||
|
||||
#[cfg(unix)]
|
||||
fn server_config_path(&self, port: u16) -> PathBuf {
|
||||
let config_file_name = format!("shadowsocks-server-{}.json", port);
|
||||
let config_file_name = format!("shadowsocks-server-{port}.json");
|
||||
let mut config_file_path = self.svr_cfg.server_working_directory.clone();
|
||||
config_file_path.push(&config_file_name);
|
||||
config_file_path
|
||||
@@ -415,7 +415,7 @@ impl Manager {
|
||||
|
||||
trace!("created standalone server with config {:?}", config);
|
||||
|
||||
let config_file_content = format!("{}", config);
|
||||
let config_file_content = format!("{config}");
|
||||
|
||||
match OpenOptions::new().write(true).create(true).open(&config_file_path) {
|
||||
Err(err) => {
|
||||
@@ -484,7 +484,7 @@ impl Manager {
|
||||
Err(..) => {
|
||||
error!("unrecognized method \"{}\", req: {:?}", m, req);
|
||||
|
||||
let err = format!("unrecognized method \"{}\"", m);
|
||||
let err = format!("unrecognized method \"{m}\"");
|
||||
return Ok(AddResponse(err));
|
||||
}
|
||||
},
|
||||
@@ -523,7 +523,7 @@ impl Manager {
|
||||
Err(..) => {
|
||||
error!("unrecognized mode \"{}\", req: {:?}", mode, req);
|
||||
|
||||
let err = format!("unrecognized mode \"{}\"", mode);
|
||||
let err = format!("unrecognized mode \"{mode}\"");
|
||||
return Ok(AddResponse(err));
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user