Skip to content

Commit c8c0e82

Browse files
committed
f - Implement EventHandler for Arc<T>
1 parent 7ea8237 commit c8c0e82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/util/events.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use io;
2727
use prelude::*;
2828
use core::time::Duration;
2929
use core::ops::Deref;
30+
use sync::Arc;
3031

3132
/// Some information provided on receipt of payment depends on whether the payment received is a
3233
/// spontaneous payment or a "conventional" lightning payment that's paying an invoice.
@@ -569,3 +570,9 @@ impl<F> EventHandler for F where F: Fn(&Event) {
569570
self(event)
570571
}
571572
}
573+
574+
impl<T: EventHandler> EventHandler for Arc<T> {
575+
fn handle_event(&self, event: &Event) {
576+
self.deref().handle_event(event)
577+
}
578+
}

0 commit comments

Comments
 (0)