Skip to content

Conversation

hicklin
Copy link
Contributor

@hicklin hicklin commented Aug 18, 2025

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.

zeenix
zeenix previously approved these changes Aug 18, 2025
Copy link
Contributor

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

sgued
sgued previously approved these changes Aug 22, 2025
Copy link
Contributor

@sgued sgued left a 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.

@hicklin hicklin force-pushed the impl_try_from_for_deque branch 2 times, most recently from 5a5388d to 63e9a67 Compare September 8, 2025 12:06
@hicklin hicklin force-pushed the impl_try_from_for_deque branch from 63e9a67 to 73d8fa2 Compare September 8, 2025 12:12
@hicklin hicklin force-pushed the impl_try_from_for_deque branch from 73d8fa2 to 75dbe63 Compare September 8, 2025 12:12
Copy link
Contributor

@zeenix zeenix left a 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.

@zeenix zeenix added this pull request to the merge queue Sep 8, 2025
Merged via the queue into rust-embedded:main with commit ae6e2ab Sep 8, 2025
21 checks passed
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.

Implement the From or TryFrom traits for Deque
3 participants