Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ozwaldorf committed May 17, 2024
1 parent a1bac1b commit f2c618d
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 17 deletions.
5 changes: 3 additions & 2 deletions core/archive/src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ struct ArchiveInner<C: Collection> {

impl<C: Collection> BuildGraph for Archive<C> {
fn build_graph() -> fdi::DependencyGraph {
fdi::DependencyGraph::new()
.with_infallible(Self::new.with_event_handler("start", insertion_task::<C>.wrap_with_spawn()))
fdi::DependencyGraph::new().with_infallible(
Self::new.with_event_handler("start", insertion_task::<C>.wrap_with_spawn()),
)
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/blockstore-server/src/blockstore_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ impl<C: Collection> BlockstoreServer<C> {

impl<C: Collection> BuildGraph for BlockstoreServer<C> {
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()))
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/broadcast/src/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ impl<C: Collection> Broadcast<C> {

impl<C: Collection> BuildGraph for Broadcast<C> {
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))
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/dack-aggregator/src/dack_aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ impl<C: Collection> DeliveryAcknowledgmentAggregator<C> {

impl<C: Collection> BuildGraph for DeliveryAcknowledgmentAggregator<C> {
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()))
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/handshake/src/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ impl<C: Collection> Handshake<C> {

impl<C: Collection> BuildGraph for Handshake<C> {
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()))
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/pinger/src/pinger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ impl<C: Collection> PingerInterface<C> for Pinger<C> {}

impl<C: Collection> BuildGraph for Pinger<C> {
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()))
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/pool/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ where

impl<C: Collection> BuildGraph for PoolProvider<C, QuinnMuxer> {
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()))
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/rep-collector/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ impl<C: Collection> ReputationAggregator<C> {

impl<C: Collection> BuildGraph for ReputationAggregator<C> {
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()))
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/resolver/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ impl<C: Collection> Resolver<C> {

impl<C: Collection> BuildGraph for Resolver<C> {
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()))
}
}

Expand Down
5 changes: 3 additions & 2 deletions core/signer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@ impl AsyncWorker for SignerWorker {

impl<C: Collection> BuildGraph for Signer<C> {
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()),
)
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/topology/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ impl<C: Collection> Topology<C> {

impl<C: Collection> BuildGraph for Topology<C> {
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()))
}
}

Expand Down
6 changes: 5 additions & 1 deletion lib/fdi/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ pub trait MethodExt<P>: Sized + Method<P> {
}

#[inline(always)]
fn with_event_handler<H, Y>(self, event: &'static str, handler: H) -> impl Method<P, Output = Self::Output>
fn with_event_handler<H, Y>(
self,
event: &'static str,
handler: H,
) -> impl Method<P, Output = Self::Output>
where
H: Method<Y>,
{
Expand Down
18 changes: 15 additions & 3 deletions lib/fdi/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ fn demo_captured() {
let method_handler = (|a: Consume<A>| 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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit f2c618d

Please sign in to comment.