Fix clippy lints

This commit is contained in:
Paul Hauner
2019-04-03 16:23:09 +11:00
parent 1d34e2b2a5
commit 1913be0c6f
22 changed files with 76 additions and 105 deletions

View File

@@ -25,9 +25,9 @@ use tokio::timer::Interval;
/// sub-services in multiple threads.
pub struct Client<T: ClientTypes> {
/// Configuration for the lighthouse client.
config: ClientConfig,
_config: ClientConfig,
/// The beacon chain for the running client.
beacon_chain: Arc<BeaconChain<T::DB, T::SlotClock, T::ForkChoice>>,
_beacon_chain: Arc<BeaconChain<T::DB, T::SlotClock, T::ForkChoice>>,
/// Reference to the network service.
pub network: Arc<NetworkService>,
/// Signal to terminate the RPC server.
@@ -90,17 +90,18 @@ impl<TClientType: ClientTypes> Client<TClientType> {
network_logger,
)?;
let mut rpc_exit_signal = None;
// spawn the RPC server
if config.rpc_conf.enabled {
rpc_exit_signal = Some(rpc::start_server(
let rpc_exit_signal = if config.rpc_conf.enabled {
Some(rpc::start_server(
&config.rpc_conf,
executor,
network_send,
beacon_chain.clone(),
&log,
));
}
))
} else {
None
};
let (slot_timer_exit_signal, exit) = exit_future::signal();
if let Ok(Some(duration_to_next_slot)) = beacon_chain.slot_clock.duration_to_next_slot() {
@@ -129,8 +130,8 @@ impl<TClientType: ClientTypes> Client<TClientType> {
}
Ok(Client {
config,
beacon_chain,
_config: config,
_beacon_chain: beacon_chain,
rpc_exit_signal,
slot_timer_exit_signal: Some(slot_timer_exit_signal),
log,

View File

@@ -14,7 +14,7 @@ pub fn run<T: ClientTypes>(client: &Client<T>, executor: TaskExecutor, exit: Exi
// notification heartbeat
let interval = Interval::new(Instant::now(), Duration::from_secs(5));
let log = client.log.new(o!("Service" => "Notifier"));
let _log = client.log.new(o!("Service" => "Notifier"));
// TODO: Debugging only
let counter = Arc::new(Mutex::new(0));