mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-06 08:14:07 +00:00
chore: clippy fix
This commit is contained in:
@@ -70,7 +70,14 @@ use serde::{Deserialize, Serialize};
|
||||
use shadowsocks::relay::socks5::Address;
|
||||
use shadowsocks::{
|
||||
config::{
|
||||
ManagerAddr, Mode, ReplayAttackPolicy, ServerAddr, ServerConfig, ServerSource, ServerUser, ServerUserManager,
|
||||
ManagerAddr,
|
||||
Mode,
|
||||
ReplayAttackPolicy,
|
||||
ServerAddr,
|
||||
ServerConfig,
|
||||
ServerSource,
|
||||
ServerUser,
|
||||
ServerUserManager,
|
||||
ServerWeight,
|
||||
},
|
||||
crypto::CipherKind,
|
||||
|
||||
@@ -64,7 +64,7 @@ impl Timer for TokioTimer {
|
||||
|
||||
fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant) {
|
||||
if let Some(sleep) = sleep.as_mut().downcast_mut_pin::<TokioSleep>() {
|
||||
sleep.reset(new_deadline.into())
|
||||
sleep.reset(new_deadline)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,17 @@ impl<B> Clone for HttpClient<B> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<B> Default for HttpClient<B>
|
||||
where
|
||||
B: Body + Send + Unpin + Debug + 'static,
|
||||
B::Data: Send,
|
||||
B::Error: Into<Box<dyn ::std::error::Error + Send + Sync>>,
|
||||
{
|
||||
fn default() -> Self {
|
||||
HttpClient::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<B> HttpClient<B>
|
||||
where
|
||||
B: Body + Send + Unpin + Debug + 'static,
|
||||
|
||||
@@ -164,7 +164,7 @@ impl OnlineConfigService {
|
||||
|
||||
let parsed_body = match String::from_utf8(collected_body) {
|
||||
Ok(b) => b,
|
||||
Err(..) => return Err(io::Error::new(io::ErrorKind::Other, "body contains non-utf8 bytes").into()),
|
||||
Err(..) => return Err(io::Error::new(io::ErrorKind::Other, "body contains non-utf8 bytes")),
|
||||
};
|
||||
|
||||
let online_config = match Config::load_from_str(&parsed_body, ConfigType::OnlineConfig) {
|
||||
@@ -174,7 +174,7 @@ impl OnlineConfigService {
|
||||
"server-loader task failed to load from url: {}, error: {}",
|
||||
self.config_url, err
|
||||
);
|
||||
return Err(io::Error::new(io::ErrorKind::Other, err).into());
|
||||
return Err(io::Error::new(io::ErrorKind::Other, err));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ impl OnlineConfigService {
|
||||
"server-loader task failed to load from url: {}, error: {}",
|
||||
self.config_url, err
|
||||
);
|
||||
return Err(io::Error::new(io::ErrorKind::Other, err).into());
|
||||
return Err(io::Error::new(io::ErrorKind::Other, err));
|
||||
}
|
||||
|
||||
let after_read_time = Instant::now();
|
||||
|
||||
@@ -24,7 +24,12 @@ use shadowsocks_service::shadowsocks::relay::socks5::Address;
|
||||
use shadowsocks_service::{
|
||||
acl::AccessControl,
|
||||
config::{
|
||||
read_variable_field_value, Config, ConfigType, LocalConfig, LocalInstanceConfig, ProtocolType,
|
||||
read_variable_field_value,
|
||||
Config,
|
||||
ConfigType,
|
||||
LocalConfig,
|
||||
LocalInstanceConfig,
|
||||
ProtocolType,
|
||||
ServerInstanceConfig,
|
||||
},
|
||||
local::{loadbalancing::PingBalancer, Server},
|
||||
@@ -39,7 +44,8 @@ use shadowsocks_service::{
|
||||
use crate::logging;
|
||||
use crate::{
|
||||
config::{Config as ServiceConfig, RuntimeMode},
|
||||
monitor, vparser,
|
||||
monitor,
|
||||
vparser,
|
||||
};
|
||||
|
||||
#[cfg(feature = "local-dns")]
|
||||
|
||||
Reference in New Issue
Block a user