Skip to content

Conversation

anforowicz
Copy link

PTAL? Please see the individual commit descriptions for more details.

Before the changes in `fn new`, the type of `MaybeUninit::uninit()`
would be inferred to be `MaybeUninit<[MaybeUninit<...>; CAP]>` which
seems somewhat unexpected.  This commit rewrites this expression so that
no `unsafe` is needed.

Similarily, before the changes in `fn zero_filled`, the type of
`MaybeUninit::zeroed()` would be inferred to be
`MaybeUninit<[MaybeUninit<...>; CAP]>`.  This commit also rewrites this
expression so that no `unsafe` is needed.
The safe code results in the same, fast assembly code.
The safe code should result in the same, fast assembly code.
This also opportunistically reduces the amount of `unsafe` in
`ArrayString::remove`.
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