-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicit impl Clone for tx to avoid T: Clone (#865)
`#[derive(Clone)]` on a type `struct Foo<T>` adds an impl that requires that `T: Clone`: ```rust impl<T: Clone> Clone for Foo<T> ``` which is unfortunate in the case of senders, because we don't want to require that the items being sent are `Clone` for the channel sender to be `Clone`. This PR adds an explicit `impl Clone` for the bounded and unbounded sender types which does not have the `T: Clone` bound. Note that this is _also_ an issue with `#[derive(Debug)]`, but that one is harder to work around as `chan::Tx` _also_ has `#[derive(Debug)]`, as does `chan::Chan`, so we'd have to add explicit impls for all of them to make progress.
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 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
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