Skip to content

Commit

Permalink
fix: feature flag Datagram::into_data
Browse files Browse the repository at this point in the history
`Datagram::into_data` is used in `neqo_common::udp` only. `neqo_common::udp` is
behind the `udp` feature. The feature is not part of the crate's default
features. Thus a plain `cargo check` rightly complains with:

```
warning: method `into_data` is never used
  --> neqo-common/src/datagram.rs:58:19
   |
20 | impl Datagram {
   | ------------- method in this implementation
...
58 |     pub(crate) fn into_data(self) -> Vec<u8> {
   |                   ^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default
```

This commit hides `into_data` behind the `udp` feature as well.
  • Loading branch information
mxinden committed Feb 29, 2024
1 parent 7f6fc8b commit 3417707
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions neqo-common/src/datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl Datagram {
self.ttl
}

#[cfg(feature = "udp")]
#[must_use]
pub(crate) fn into_data(self) -> Vec<u8> {
self.d
Expand Down

0 comments on commit 3417707

Please sign in to comment.