feat(watch): allow non-Clone channel values - #313
Merged
Conversation
Relax watch::channel construction so non-Clone values can be published, replaced, subscribed to, and observed for changes while keeping Clone requirements localized to owning reads. Add focused integration coverage and document the public contract. Signed-off-by: tayfuryldzz <yildiztayfur668@gmail.com>
tisonkun
reviewed
Sep 14, 2026
Comment on lines
+84
to
+85
| /// The value type does not need to implement `Clone` for construction, publication, or change | ||
| /// notification. Only owning reads through [`Receiver::get`] and [`Receiver::recv`] require it. |
Member
There was a problem hiding this comment.
Suggested change
| /// The value type does not need to implement `Clone` for construction, publication, or change | |
| /// notification. Only owning reads through [`Receiver::get`] and [`Receiver::recv`] require it. |
Too many deatils.
tisonkun
reviewed
Sep 14, 2026
Signed-off-by: tayfuryldzz <yildiztayfur668@gmail.com>
TayfurYldz
force-pushed
the
feat/watch-non-clone-channel
branch
from
September 14, 2026 15:29
fe836b3 to
a303df5
Compare
Contributor
Author
|
Yes, the non-`Clone` regression coverage is still useful because #311
explicitly asks for focused coverage of
construction/publication/change tracking with a non-`Clone` payload,
including `send_replace` returning the previous value.
I agreed that a separate test file was unnecessary, so I moved that
coverage into the existing `tests-integration/tests/watch_test.rs` and
removed the standalone file. I also removed the extra constructor
documentation from the other review comment.
The cleaned head is `a303df5`, and the repository CI now passes
completely: lint/check/bench compilation, the full Linux/macOS/Windows
test matrix on stable and Rust 1.86, Miri, and the required guardian
job.
…On Mon, 14 Sep 2026 07:22:49 -0700, tison ***@***.***> wrote:
@tisonkun commented on this pull request.
On [tests-integration/tests/watch_non_clone_test.rs](#313 (comment)):
Is this really needed?
—
Reply to this email directly, [view it on GitHub](#313?email_source=notifications&email_token=BY2D2SUDUU2IECIT4L4S3YT5O75LTA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMJZHA4DIOJZGE2KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-5198849914), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/BY2D2SRP3FZLRFIRCFWZXLD5O75LTAVCNFSNUABFKJSXA33TNF2G64TZHM4DOOBWGI2DAMRVHNEXG43VMU5TKNBVGA2DGMZRGI22C5QC).
You are receiving this because you authored the thread.
|
tisonkun
approved these changes
Sep 14, 2026
tisonkun
left a comment
Member
There was a problem hiding this comment.
Thanks for your contribution @TayfurYldz !
Merging...
tisonkun
enabled auto-merge (squash)
September 14, 2026 15:41
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
watch::channelso construction, publication, replacement, subscription, and change tracking do not requireT: CloneClonelocalized toReceiver::getandReceiver::recvClonepayload, includingsend_replaceownershipCloses #311.
Testing
Repository CI is the authoritative validation for
cargo x lint,cargo x check,cargo x bench --no-run,cargo x test --no-capture, and Miri.