From: Matt Corallo Date: Sun, 31 May 2020 03:16:29 +0000 (-0400) Subject: Always refer to Deref types with where clauses instead of direct X-Git-Tag: v0.0.12~32^2~7 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a05b3fa8974c80a4959179346b55c254ddf509b8;p=rust-lightning 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. --- diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs index 644c3214a..fe3914545 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 {