From a05b3fa8974c80a4959179346b55c254ddf509b8 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 30 May 2020 23:16:29 -0400 Subject: [PATCH] Always refer to Deref types with where clauses instead of direct This makes it a little easier to write C bindings generation as we only have to handle one case instead of both. --- lightning/src/chain/chaininterface.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs index 644c3214..fe391454 100644 --- a/lightning/src/chain/chaininterface.rs +++ b/lightning/src/chain/chaininterface.rs @@ -245,13 +245,15 @@ pub type BlockNotifierRef<'a, C> = BlockNotifier<'a, &'a ChainListener, C>; /// or a BlockNotifierRef for conciseness. See their documentation for more details, but essentially /// you should default to using a BlockNotifierRef, and use a BlockNotifierArc instead when you /// require ChainListeners with static lifetimes, such as when you're using lightning-net-tokio. -pub struct BlockNotifier<'a, CL: Deref + 'a, C: Deref> where C::Target: ChainWatchInterface { +pub struct BlockNotifier<'a, CL: Deref + 'a, C: Deref> + where CL::Target: ChainListener + 'a, C::Target: ChainWatchInterface { listeners: Mutex>, chain_monitor: C, phantom: PhantomData<&'a ()>, } -impl<'a, CL: Deref + 'a, C: Deref> BlockNotifier<'a, CL, C> where C::Target: ChainWatchInterface { +impl<'a, CL: Deref + 'a, C: Deref> BlockNotifier<'a, CL, C> + where CL::Target: ChainListener + 'a, C::Target: ChainWatchInterface { /// Constructs a new BlockNotifier without any listeners. pub fn new(chain_monitor: C) -> BlockNotifier<'a, CL, C> { BlockNotifier { -- 2.30.2