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

Add zero_filled constructor #197

Merged
merged 3 commits into from Aug 14, 2021
Merged

Add zero_filled constructor #197

merged 3 commits into from Aug 14, 2021

Conversation

c410-f3r
Copy link
Contributor

Fixes #196

vec.set_len(CAP);
}
vec
}
Copy link
Owner

Choose a reason for hiding this comment

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

I think we can and should copy the code in fn new verbatim, but instead of uninit, we use MaybeUninit::zeroed and len: CAP and it should be good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

src/array_string.rs Outdated Show resolved Hide resolved
@bluss bluss merged commit e209a50 into bluss:master Aug 14, 2021
@bluss
Copy link
Owner

bluss commented Aug 14, 2021

Thanks!

@c410-f3r
Copy link
Contributor Author

Thank you!

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.

[ArrayString] Infallible constructor to fill inner array
2 participants