cargo fmt with stable defaults (#876)

This commit is contained in:
James Wilson
2023-03-21 16:53:47 +00:00
committed by GitHub
parent c63ff6ec6d
commit 7c252fccf7
110 changed files with 663 additions and 1949 deletions
+11 -31
View File
@@ -5,27 +5,13 @@
use super::Block;
use crate::{
client::OnlineClientT,
config::{
Config,
Header,
},
error::{
BlockError,
Error,
},
config::{Config, Header},
error::{BlockError, Error},
utils::PhantomDataSendSync,
};
use derivative::Derivative;
use futures::{
future::Either,
stream,
Stream,
StreamExt,
};
use std::{
future::Future,
pin::Pin,
};
use futures::{future::Either, stream, Stream, StreamExt};
use std::{future::Future, pin::Pin};
type BlockStream<T> = Pin<Box<dyn Stream<Item = Result<T, Error>> + Send>>;
type BlockStreamRes<T> = Result<BlockStream<T>, Error>;
@@ -71,13 +57,11 @@ where
// for the latest block and use that.
let block_hash = match block_hash {
Some(hash) => hash,
None => {
client
.rpc()
.block_hash(None)
.await?
.expect("didn't pass a block number; qed")
}
None => client
.rpc()
.block_hash(None)
.await?
.expect("didn't pass a block number; qed"),
};
let block_header = match client.rpc().header(Some(block_hash)).await? {
@@ -145,12 +129,8 @@ where
// Adjust the subscription stream to fill in any missing blocks.
BlockStreamRes::Ok(
subscribe_to_block_headers_filling_in_gaps(
client,
last_finalized_block_num,
sub,
)
.boxed(),
subscribe_to_block_headers_filling_in_gaps(client, last_finalized_block_num, sub)
.boxed(),
)
})
}