Skip to content

fix(fiber): allow cloning fiber::channel

Yaroslav Dynnikov requested to merge clonable-channels into master

If the inner type of a channel isn't clonable, an attempt to derive(Clone) for a struct, containing this channel, complains:

299 |     #[derive(Clone)]
    |              ----- in this derive macro expansion
300 |     struct MyChannel(fiber::Channel<NonClonable>);
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone`
    |                               is not implemented for `NonClonable`

This patch makes channels always clonable as internally they only use Rc (which is always clonable too).

Edited by Yaroslav Dynnikov

Merge request reports