Make lightning-block-sync's init module slightly more generic 2022-03-listen-send-sync
authorMatt Corallo <git@bluematt.me>
Wed, 9 Mar 2022 18:15:30 +0000 (18:15 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 9 Mar 2022 18:20:43 +0000 (18:20 +0000)
commit84a08dbf8ab03875c8afd0e6643f82c8cbb30198
tree3f3eb7e485071712595f179b0c06a75948c4d3a3
parent6259e7a674c1e5ca216e75ffcdbe8884c167bf57
Make lightning-block-sync's init module slightly more generic

Users who want to use lightning-block-sync's init module would
be reasonable in wanting to use it in a multithreaded environment,
however because it takes a list of listeners as dyn chain::Listen
without any Send or Sync bound they fail in doing so.

Here we make the type bounds on `chain::Listen` generic across
`chain::Listen + ?Sized`, which the existing bound of `&dyn
chain::Listen` satisfies. Thus, this is strictly less restrictive
and allows for the use of `&dyn chain::Listen + Send + Sync`.
lightning-block-sync/src/init.rs