heapless
heapless copied to clipboard
Implements TryFrom for Deque from array
Fixes #522.
Ideally, this PR is updated after PR #521 is merged to simplify the tests.
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.
@newAM, would you be able to review or remove the change request flag as I don't think that this can be merged while that flag is active.
@newAM and @reitermarkus , any chance you can have at look an my replies? @newAM I think your "requested change" flag is still up so this cannot be merged before that flag is cleared.
@newAM and @reitermarkus , any chance you can have at look an my replies? @newAM I think your "requested change" flag is still up so this cannot be merged before that flag is cleared.
They're not very available these days so best to close this and create another and then I and @sgued can take a look (like done for #571 today).
OK. I'm closing this PR and opening a new one.