Skip to content

Commit b0f1f5a

Browse files
committed
f - Implement EventHandler for Arc<T>
1 parent afdb131 commit b0f1f5a

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
@@ -28,6 +28,7 @@ use io;
2828
use prelude::*;
2929
use core::time::Duration;
3030
use core::ops::Deref;
31+
use sync::Arc;
3132

3233
/// Some information provided on receipt of payment depends on whether the payment received is a
3334
/// spontaneous payment or a "conventional" lightning payment that's paying an invoice.
@@ -577,3 +578,9 @@ impl<F> EventHandler for F where F: Fn(&Event) {
577578
self(event)
578579
}
579580
}
581+
582+
impl<T: EventHandler> EventHandler for Arc<T> {
583+
fn handle_event(&self, event: &Event) {
584+
self.deref().handle_event(event)
585+
}
586+
}

0 commit comments

Comments
 (0)