Fix clippy suggestions. (#179)

* Fix clippy errors.

* Cargo fmt.

* Enable clippy checks.

* Create if does not exist.

* Fix warnings and enable sccache for clippy.

* chmod +x

* Revert and ignore errors.

* Update cancel-workflow-action.

* Fixes.

* Clippy fixes.

* Fix compilation.

* Fix new clippy warnings.

* fmt --all

* Fix the rest.

* fmt --all

* Conditional.

* Bump smallvec.

* Use separate cache dir for clippy to prevent races.

* Remove unused imports in tests

* Remove "useless conversion"

* Move clippy to main worfklow to avoid clashes.

* Fix clippy error.

* Fix remaning clippy errors.

* cargo fmt --all

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
This commit is contained in:
Tomasz Drwięga
2020-07-20 19:17:32 +02:00
committed by Bastian Köcher
parent 65852944e3
commit bdf6901ce2
31 changed files with 159 additions and 197 deletions
+6 -8
View File
@@ -156,9 +156,10 @@ pub async fn run_async(params: Params, exit: Box<dyn Future<Output = ()> + Unpin
Ok(())
}
fn initial_next_events<'a>(
chains: &'a HashMap<ChainId, RefCell<Chain>>,
) -> Vec<Pin<Box<dyn Future<Output = Result<(ChainId, RawClientEvent), Error>> + 'a>>> {
type EventsResult = Result<(ChainId, RawClientEvent), Error>;
type EventsFuture<'a> = Pin<Box<dyn Future<Output = EventsResult> + 'a>>;
fn initial_next_events<'a>(chains: &'a HashMap<ChainId, RefCell<Chain>>) -> Vec<EventsFuture<'a>> {
chains
.values()
.map(|chain_cell| async move {
@@ -175,12 +176,9 @@ fn initial_next_events<'a>(
}
async fn next_event<'a>(
next_events: Vec<Pin<Box<dyn Future<Output = Result<(ChainId, RawClientEvent), Error>> + 'a>>>,
next_events: Vec<EventsFuture<'a>>,
chains: &'a HashMap<ChainId, RefCell<Chain>>,
) -> (
Result<(Hash, RawClientEvent), Error>,
Vec<Pin<Box<dyn Future<Output = Result<(ChainId, RawClientEvent), Error>> + 'a>>>,
) {
) -> (Result<(Hash, RawClientEvent), Error>, Vec<EventsFuture<'a>>) {
let (result, _, mut rest) = future::select_all(next_events).await;
match result {