-
Notifications
You must be signed in to change notification settings - Fork 124
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,12 +53,6 @@ impl Datagram { | |
pub fn ttl(&self) -> Option<u8> { | ||
self.ttl | ||
} | ||
|
||
#[cfg(feature = "udp")] | ||
#[must_use] | ||
pub(crate) fn into_data(self) -> Vec<u8> { | ||
self.d | ||
} | ||
} | ||
|
||
impl Deref for Datagram { | ||
|
@@ -83,6 +77,12 @@ impl std::fmt::Debug for Datagram { | |
} | ||
} | ||
|
||
impl From<Datagram> for Vec<u8> { | ||
fn from(datagram: Datagram) -> Self { | ||
datagram.d | ||
} | ||
} | ||
|
||
Comment on lines
+80
to
+85
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. The Given that Long story short, this just exposes |
||
#[cfg(test)] | ||
use test_fixture::datagram; | ||
|
||
|
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 aFrom<Datagram> for Vec<u8>
(see comment below). Instead of callinginto_data
, this line first leverages the newFrom
implementation and then, as before, converts it into aBytes
(into
at the end).None of these methods allocate.