Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce non zero capacity for channel #715

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Licenser
Copy link
Contributor

This aligns the function with it's documentation and will result in easier to resolve errors for problems such as #712.

closes #712

@Licenser
Copy link
Contributor Author

this fails in quite a few places but I don't think those failures are related to my changes

src/sync/channel.rs Outdated Show resolved Hide resolved
@Licenser
Copy link
Contributor Author

I've been doing some thinking and perhaps instead of guarding against zero we could use the type checker to make sure that we never get zero by using NonZeroUsize what do you think?

@Licenser
Copy link
Contributor Author

ah strike that, it requires to be manually wrapped, however, it could be used for the internal functions? as in the Channel struct

@k-nasa
Copy link
Member

k-nasa commented Mar 9, 2020

this fails in quite a few places but I don't think those failures are related to my changes

I think it can be fixed by rebase master.

Licenser and others added 2 commits March 11, 2020 20:58
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
@Licenser
Copy link
Contributor Author

Sorry for the late reply / rebase, got dragged into $otherrthings ™️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"capacity must be positive" error when sending between tasks
3 participants