fmt
This commit is contained in:
parent
272c3479a8
commit
afa2c2347f
|
|
@ -52,9 +52,9 @@ mod config;
|
|||
mod constants;
|
||||
mod meta_addr;
|
||||
mod network;
|
||||
mod policies;
|
||||
mod peer;
|
||||
mod peer_set;
|
||||
mod policies;
|
||||
mod protocol;
|
||||
mod timestamp_collector;
|
||||
|
||||
|
|
@ -62,8 +62,8 @@ pub use crate::{
|
|||
address_book::AddressBook,
|
||||
config::Config,
|
||||
peer_set::init,
|
||||
protocol::internal::{Request, Response},
|
||||
policies::{RetryErrors, RetryLimit},
|
||||
protocol::internal::{Request, Response},
|
||||
};
|
||||
|
||||
/// Types used in the definition of [`Request`] and [`Response`] messages.
|
||||
|
|
|
|||
|
|
@ -197,7 +197,14 @@ where
|
|||
|
||||
/// Given a channel that signals a need for new peers, try to connect to a peer
|
||||
/// and send the resulting `peer::Client` through a channel.
|
||||
#[instrument(skip(new_peer_interval, demand_tx, demand_rx, candidates, connector, success_tx))]
|
||||
#[instrument(skip(
|
||||
new_peer_interval,
|
||||
demand_tx,
|
||||
demand_rx,
|
||||
candidates,
|
||||
connector,
|
||||
success_tx
|
||||
))]
|
||||
async fn crawl_and_dial<C, S>(
|
||||
new_peer_interval: std::time::Duration,
|
||||
mut demand_tx: mpsc::Sender<()>,
|
||||
|
|
@ -213,7 +220,13 @@ where
|
|||
S: Service<Request, Response = Response, Error = BoxedStdError>,
|
||||
S::Future: Send + 'static,
|
||||
{
|
||||
use futures::{future::{select, Either::{Left, Right}}, TryFutureExt};
|
||||
use futures::{
|
||||
future::{
|
||||
select,
|
||||
Either::{Left, Right},
|
||||
},
|
||||
TryFutureExt,
|
||||
};
|
||||
|
||||
let mut handshakes = FuturesUnordered::new();
|
||||
// <FuturesUnordered as Stream> returns None when empty.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use tower::retry::Policy;
|
||||
use futures::future;
|
||||
use tower::retry::Policy;
|
||||
|
||||
/// A very basic retry policy with a limited number of retry attempts.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ impl Runnable for ConfigCmd {
|
|||
|
||||
"
|
||||
.to_owned(); // The default name and location of the config file is defined in ../commands.rs
|
||||
|
||||
// this avoids a ValueAfterTable error
|
||||
// https://github.com/alexcrichton/toml-rs/issues/145
|
||||
let conf = toml::Value::try_from(default_config).unwrap();
|
||||
output += &toml::to_string_pretty(&conf)
|
||||
.expect("default config should be serializable");
|
||||
output += &toml::to_string_pretty(&conf).expect("default config should be serializable");
|
||||
match self.output_file {
|
||||
Some(ref output_file) => {
|
||||
use std::{fs::File, io::Write};
|
||||
|
|
|
|||
Loading…
Reference in New Issue