chore: make clippy lint happy (#225)

* chore: make clippy happy

* chore: cargo fmt

* chore: cargo fmt
This commit is contained in:
Cluas
2022-11-10 02:04:31 +08:00
committed by GitHub
parent 4bd5717ab1
commit dfa26ec6f8
13 changed files with 167 additions and 207 deletions

View File

@@ -75,7 +75,6 @@ mod stats;
mod tls;
use crate::config::{get_config, reload_config, VERSION};
use crate::errors::Error;
use crate::pool::{ClientServerMap, ConnectionPool};
use crate::prometheus::start_metric_server;
use crate::stats::{Collector, Reporter, REPORTER};
@@ -171,13 +170,10 @@ async fn main() {
if config.general.autoreload {
info!("Automatically reloading config");
match reload_config(autoreload_client_server_map.clone()).await {
Ok(changed) => {
if changed {
get_config().show()
}
if let Ok(changed) = reload_config(autoreload_client_server_map.clone()).await {
if changed {
get_config().show()
}
Err(_) => (),
};
}
}
@@ -202,10 +198,7 @@ async fn main() {
_ = sighup_signal.recv() => {
info!("Reloading config");
match reload_config(client_server_map.clone()).await {
Ok(_) => (),
Err(_) => (),
};
_ = reload_config(client_server_map.clone()).await;
get_config().show();
},
@@ -278,14 +271,6 @@ async fn main() {
}
Err(err) => {
match err {
// Don't count the clients we rejected.
Error::ShuttingDown => (),
_ => {
// drain_tx.send(-1).await.unwrap();
}
}
warn!("Client disconnected with error {:?}", err);
}
};