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

Making net feature flag show in documentation for net::UdpSocket #6938

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tokio/src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ cfg_net! {
pub use tcp::socket::TcpSocket;

mod udp;
#[doc(inline)]
pub use udp::UdpSocket;
Comment on lines +49 to 50
Copy link
Contributor Author

@jofas jofas Oct 26, 2024

Choose a reason for hiding this comment

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

Alternatively one could wrap the re-export here in another cfg_net!, but I thought #[doc(inline)] would be less confusing:

Suggested change
#[doc(inline)]
pub use udp::UdpSocket;
cfg_net! {
pub use udp::UdpSocket;
}

Although, given that the net::udp module is already wrapped in a cfg_net! here, I believe we could also replace this cfg_net! (whose sole purpose is for the feature gate to show up in the docs in the first place, I reckon) with the one on the re-export I suggested above, in which case this would be the more straight-forward solution IMO.

}
}
Expand Down
Loading