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

core: replace Once::data inner type to MaybeUninit #3206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iamlockon
Copy link

There is a TODO suggesting we should use mem::uninitialized to replace Option, but since the suggested function is deprecated, we should use MaybeUninit instead. This PR makes exactly that change.

Motivation

I am learning tracing source code, and spotted this TODO and feel I might be able to help address this one.

Solution

Updated the Once::data inner type from Option<T> to MaybeUninit<T>.

There is a TODO suggesting we should use mem::uninitialized to replace
Option, but since the suggested function is deprecated, we should use
MaybeUninit instead. This PR makes exactly that change.

Signed-off-by: Jay Wang <[email protected]>
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