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

Change the trait bound for Queue elements from Copy to Unpin #33

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

Conversation

Neo-Zhixing
Copy link

Right now Queue requires that all elements needs to be Copy. This seems correct, because xQueueSend will copy a predetermined bytes from *pvItemToQueue to the queue.

However, let's consider a type that is not Copy. Vec can be cheaply moved because it only contains ptr, capacity and length, but it is not Copy.

I believe that here we only need to require the item to be Unpin to guarantee that they can be freely moved.

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.

1 participant