Skip to content

Commit 81aac1c

Browse files
committed
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.
1 parent 07ef52f commit 81aac1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lightning/src/chain/chaininterface.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,15 @@ pub type BlockNotifierRef<'a, C> = BlockNotifier<'a, &'a ChainListener, C>;
245245
/// or a BlockNotifierRef for conciseness. See their documentation for more details, but essentially
246246
/// you should default to using a BlockNotifierRef, and use a BlockNotifierArc instead when you
247247
/// require ChainListeners with static lifetimes, such as when you're using lightning-net-tokio.
248-
pub struct BlockNotifier<'a, CL: Deref<Target = ChainListener + 'a> + 'a, C: Deref> where C::Target: ChainWatchInterface {
248+
pub struct BlockNotifier<'a, CL: Deref + 'a, C: Deref>
249+
where CL::Target: ChainListener + 'a, C::Target: ChainWatchInterface {
249250
listeners: Mutex<Vec<CL>>,
250251
chain_monitor: C,
251252
phantom: PhantomData<&'a ()>,
252253
}
253254

254-
impl<'a, CL: Deref<Target = ChainListener + 'a> + 'a, C: Deref> BlockNotifier<'a, CL, C> where C::Target: ChainWatchInterface {
255+
impl<'a, CL: Deref + 'a, C: Deref> BlockNotifier<'a, CL, C>
256+
where CL::Target: ChainListener + 'a, C::Target: ChainWatchInterface {
255257
/// Constructs a new BlockNotifier without any listeners.
256258
pub fn new(chain_monitor: C) -> BlockNotifier<'a, CL, C> {
257259
BlockNotifier {

0 commit comments

Comments
 (0)