From f2c618de4af07f31e98c8882311e3e10a3a33d62 Mon Sep 17 00:00:00 2001 From: ozwaldorf Date: Fri, 17 May 2024 10:57:30 -0400 Subject: [PATCH] fix: fmt --- core/archive/src/archive.rs | 5 +++-- .../blockstore-server/src/blockstore_server.rs | 3 ++- core/broadcast/src/broadcast.rs | 3 ++- core/dack-aggregator/src/dack_aggregator.rs | 3 ++- core/handshake/src/handshake.rs | 3 ++- core/pinger/src/pinger.rs | 3 ++- core/pool/src/provider.rs | 3 ++- core/rep-collector/src/aggregator.rs | 3 ++- core/resolver/src/resolver.rs | 3 ++- core/signer/src/lib.rs | 5 +++-- core/topology/src/lib.rs | 3 ++- lib/fdi/src/ext.rs | 6 +++++- lib/fdi/src/tests.rs | 18 +++++++++++++++--- 13 files changed, 44 insertions(+), 17 deletions(-) diff --git a/core/archive/src/archive.rs b/core/archive/src/archive.rs index ebd3d3bb5..c7f6b0631 100644 --- a/core/archive/src/archive.rs +++ b/core/archive/src/archive.rs @@ -39,8 +39,9 @@ struct ArchiveInner { impl BuildGraph for Archive { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::new() - .with_infallible(Self::new.with_event_handler("start", insertion_task::.wrap_with_spawn())) + fdi::DependencyGraph::new().with_infallible( + Self::new.with_event_handler("start", insertion_task::.wrap_with_spawn()), + ) } } diff --git a/core/blockstore-server/src/blockstore_server.rs b/core/blockstore-server/src/blockstore_server.rs index f2571a548..6903fd67c 100644 --- a/core/blockstore-server/src/blockstore_server.rs +++ b/core/blockstore-server/src/blockstore_server.rs @@ -85,7 +85,8 @@ impl BlockstoreServer { impl BuildGraph for BlockstoreServer { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::default().with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) + fdi::DependencyGraph::default() + .with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) } } diff --git a/core/broadcast/src/broadcast.rs b/core/broadcast/src/broadcast.rs index b10841fca..38d0263b9 100644 --- a/core/broadcast/src/broadcast.rs +++ b/core/broadcast/src/broadcast.rs @@ -44,7 +44,8 @@ impl Broadcast { impl BuildGraph for Broadcast { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::new().with_infallible(Self::new.with_event_handler("start", Self::start)) + fdi::DependencyGraph::new() + .with_infallible(Self::new.with_event_handler("start", Self::start)) } } diff --git a/core/dack-aggregator/src/dack_aggregator.rs b/core/dack-aggregator/src/dack_aggregator.rs index 14215e945..5e16b54f1 100644 --- a/core/dack-aggregator/src/dack_aggregator.rs +++ b/core/dack-aggregator/src/dack_aggregator.rs @@ -53,7 +53,8 @@ impl DeliveryAcknowledgmentAggregator { impl BuildGraph for DeliveryAcknowledgmentAggregator { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::default().with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) + fdi::DependencyGraph::default() + .with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) } } diff --git a/core/handshake/src/handshake.rs b/core/handshake/src/handshake.rs index 7d05c924a..9c5c69150 100644 --- a/core/handshake/src/handshake.rs +++ b/core/handshake/src/handshake.rs @@ -110,7 +110,8 @@ impl Handshake { impl BuildGraph for Handshake { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::new().with_infallible(Self::new.with_event_handler("start", Self::start.wrap_with_spawn())) + fdi::DependencyGraph::new() + .with_infallible(Self::new.with_event_handler("start", Self::start.wrap_with_spawn())) } } diff --git a/core/pinger/src/pinger.rs b/core/pinger/src/pinger.rs index 3ca313ab0..1bf37dcd1 100644 --- a/core/pinger/src/pinger.rs +++ b/core/pinger/src/pinger.rs @@ -64,7 +64,8 @@ impl PingerInterface for Pinger {} impl BuildGraph for Pinger { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::new().with(Self::new.with_event_handler("start", Self::start.wrap_with_spawn())) + fdi::DependencyGraph::new() + .with(Self::new.with_event_handler("start", Self::start.wrap_with_spawn())) } } diff --git a/core/pool/src/provider.rs b/core/pool/src/provider.rs index 71a156c7d..77fd6e9f8 100644 --- a/core/pool/src/provider.rs +++ b/core/pool/src/provider.rs @@ -149,7 +149,8 @@ where impl BuildGraph for PoolProvider { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::new().with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) + fdi::DependencyGraph::new() + .with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) } } diff --git a/core/rep-collector/src/aggregator.rs b/core/rep-collector/src/aggregator.rs index d1caba582..ca1d85a8d 100644 --- a/core/rep-collector/src/aggregator.rs +++ b/core/rep-collector/src/aggregator.rs @@ -211,7 +211,8 @@ impl ReputationAggregator { impl BuildGraph for ReputationAggregator { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::new().with(Self::new.with_event_handler("start", Self::start.bounded().wrap_with_spawn())) + fdi::DependencyGraph::new() + .with(Self::new.with_event_handler("start", Self::start.bounded().wrap_with_spawn())) } } diff --git a/core/resolver/src/resolver.rs b/core/resolver/src/resolver.rs index ef5f7e166..2bcad9d24 100644 --- a/core/resolver/src/resolver.rs +++ b/core/resolver/src/resolver.rs @@ -70,7 +70,8 @@ impl Resolver { impl BuildGraph for Resolver { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::default().with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) + fdi::DependencyGraph::default() + .with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) } } diff --git a/core/signer/src/lib.rs b/core/signer/src/lib.rs index d3a1f7c89..d8ced1614 100644 --- a/core/signer/src/lib.rs +++ b/core/signer/src/lib.rs @@ -293,8 +293,9 @@ impl AsyncWorker for SignerWorker { impl BuildGraph for Signer { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::new() - .with_infallible(Self::init.with_event_handler("start", Self::start.wrap_with_block_on())) + fdi::DependencyGraph::new().with_infallible( + Self::init.with_event_handler("start", Self::start.wrap_with_block_on()), + ) } } diff --git a/core/topology/src/lib.rs b/core/topology/src/lib.rs index ddc6a10c0..323a4099d 100644 --- a/core/topology/src/lib.rs +++ b/core/topology/src/lib.rs @@ -130,7 +130,8 @@ impl Topology { impl BuildGraph for Topology { fn build_graph() -> fdi::DependencyGraph { - fdi::DependencyGraph::default().with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) + fdi::DependencyGraph::default() + .with(Self::init.with_event_handler("start", Self::start.wrap_with_spawn())) } } diff --git a/lib/fdi/src/ext.rs b/lib/fdi/src/ext.rs index 7932a8eb4..bb11587a6 100644 --- a/lib/fdi/src/ext.rs +++ b/lib/fdi/src/ext.rs @@ -18,7 +18,11 @@ pub trait MethodExt

: Sized + Method

{ } #[inline(always)] - fn with_event_handler(self, event: &'static str, handler: H) -> impl Method + fn with_event_handler( + self, + event: &'static str, + handler: H, + ) -> impl Method where H: Method, { diff --git a/lib/fdi/src/tests.rs b/lib/fdi/src/tests.rs index 7c243ad07..c483185e7 100644 --- a/lib/fdi/src/tests.rs +++ b/lib/fdi/src/tests.rs @@ -298,7 +298,11 @@ fn demo_captured() { let method_handler = (|a: Consume| A::capture.bind(a.0)).wrap_with(|a| a); let graph = DependencyGraph::new() - .with((|| A(17)).to_infallible().with_event_handler("start", method_handler)) + .with( + (|| A(17)) + .to_infallible() + .with_event_handler("start", method_handler), + ) .with_value(String::from("World")); let mut provider = Provider::default(); @@ -319,7 +323,11 @@ fn demo_consume() { let method_handler = consume(A::capture); let graph = DependencyGraph::new() - .with((|| A(17)).to_infallible().with_event_handler("start", method_handler)) + .with( + (|| A(17)) + .to_infallible() + .with_event_handler("start", method_handler), + ) .with_value(String::from("World")); let mut provider = Provider::default(); @@ -339,7 +347,11 @@ fn demo_bounded() { } let graph = DependencyGraph::new() - .with((|| A(17)).to_infallible().with_event_handler("start", A::capture.bounded())) + .with( + (|| A(17)) + .to_infallible() + .with_event_handler("start", A::capture.bounded()), + ) .with_value(String::from("World")); let mut provider = Provider::default();