-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
refactor(endpoint): use array::from_fn instead of unsafe MaybeUninit #1806
Conversation
With Rust 1.63.0 one can initialize a `std::array` via `std::array::from_fn`. https://doc.rust-lang.org/std/array/fn.from_fn.html Thus there is no need to start with an uninitialized array via `MaybeUninit`, initialize it and then use `unsafe` to `assume_init`. Instead one can initialize the array with the concrete elements right away.
What happened to the plan to use quinn-udp directly for neqo? |
For others, some context: #1749. For now, I am refactoring Whether long term |
I'm still curious -- does Firefox still use neqo, if it doesn't use neqo-client or neqo-server? If you're not at Mozilla, what is your goal in contributing to Neqo? |
Yes https://searchfox.org/mozilla-central/source/netwerk/socket/neqo_glue/Cargo.toml#12-15
Sorry for the confusion. Firefox uses In order to test the above Does that help @djc?
I have left rust-libp2p in December https://max-inden.de/post/2024-02-29-stepping-down/. Assuming that is where you know me from. While looking for a new job, Neqo is a great way to spend my free time. |
Yeah, that is where I knew you from -- was just wondering if someone was paying you to work on Neqo. Enjoy the time off! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
With Rust 1.63.0 one can initialize a
std::array
viastd::array::from_fn
.https://doc.rust-lang.org/std/array/fn.from_fn.html
Thus there is no need to start with an uninitialized array via
MaybeUninit
, initialize it and then useunsafe
toassume_init
. Instead one can initialize the array with the concrete elements right away.Meta:
quinn-udp
has been very helpful in mozilla/neqo#1741. Thanks!