-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Clone for With combinator (#2290)
Consider the following use-case of mpsc channels. There are two categories of producers which produce items of two distinct types, later unified in one using `With` combinator: ``` let (sender, receiver) = mspc::channel(100); let download_status = sender.clone().with(|item| { futures::future::ok(Status::Download(item)) }); let unpack_status = sender.clone().with(|item| { futures::future::ok(Status::Unpack(item)) }); ``` It would be convenient for `With` combinator to implement `Clone`, since the underlying sink, `futures::channel::mpsc::Sender`, implements it.
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters