-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Add missing examples for IpAddr enum #38077
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
/// | ||
/// use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; | ||
/// | ||
/// fn main() { |
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.
Why is there a fn main() {
here?
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.
You should be able to omit the fn main() {
even if you're using #![feature(...)]
. An example:
rust/src/libcore/sync/atomic.rs
Lines 205 to 213 in b30022a
/// ``` | |
/// #![feature(atomic_access)] | |
/// use std::sync::atomic::{AtomicBool, Ordering}; | |
/// | |
/// let mut some_bool = AtomicBool::new(true); | |
/// assert_eq!(*some_bool.get_mut(), true); | |
/// *some_bool.get_mut() = false; | |
/// assert_eq!(some_bool.load(Ordering::SeqCst), false); | |
/// ``` |
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.
I know, I just prefer to keep it.
2cb1f91
to
336e5dd
Compare
📝 🎊 @bors r+ rollup |
📌 Commit 336e5dd has been approved by |
Add missing examples for IpAddr enum r? @frewsxcv
Add missing examples for IpAddr enum r? @frewsxcv
r? @frewsxcv