-
Notifications
You must be signed in to change notification settings - Fork 126
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(udp): move udp mod from neqo-common to neqo-bin #1736
Conversation
The `udp` module is only used in the `neqo_bin` crate, more specifically by the Neqo client and server implementation. This commit moves the `udp` module to `neqo-bin`.
I'll unbreak mutants after dinner |
Benchmark resultsPerformance differences relative to 2750423.
|
contents: d.into_data().into(), | ||
contents: Vec::from(d).into(), |
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.
Is this part of the move or another change?
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.
Datagram::into_data
is changed to a From<Datagram> for Vec<u8>
(see comment below). Instead of calling into_data
, this line first leverages the new From
implementation and then, as before, converts it into a Bytes
(into
at the end).
None of these methods allocate.
impl From<Datagram> for Vec<u8> { | ||
fn from(datagram: Datagram) -> Self { | ||
datagram.d | ||
} | ||
} | ||
|
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.
Is this part of the move or another change?
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.
The udp
module needs to convert a Datagram
to a Vec
. Previously this would have been done via the pub(crate)
Datagram::into_data
.
Given that udp
module is moved outside of neqo-common
crate now, pub(crate)
into_data
is changed into a pub
From<Datagram> for Vec<u8>
implementation. See also #1695 (comment).
Long story short, this just exposes into_data
beyond the crate and implements it as a From
instead.
The
udp
module is only used in theneqo_bin
crate, more specifically by the Neqo client and server implementation. This commit moves theudp
module toneqo-bin
.Part of #1696.