-
Notifications
You must be signed in to change notification settings - Fork 221
Implements TryFrom for Deque from array #591
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Needs squashing before merging and removing the unnecessary change to .gitignore
.
5a5388d
to
63e9a67
Compare
63e9a67
to
73d8fa2
Compare
73d8fa2
to
75dbe63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, please also add details to the git commit message body, not only the PR. That's a very good practice in general, so all details are always available offline.
Previous reviews and comments can be found in pull request 524.
Fixes #522.
This PR implements the TryFrom trait for creating a Deque from a slice.
Note the use of unsafe for copying all bytes from the slice to the Deque buffer after ensuring that the Deque buffer has enough space.
Also note the use of ManuallyDrop to ensure that any heap memory referred to by the element contents is not dropped at the end of this method since the elements in the Deque buffer will be pointing to it.