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

Add missing examples for IpAddr enum #38077

Merged
merged 1 commit into from
Dec 4, 2016

Conversation

GuillaumeGomez
Copy link
Member

///
/// use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
///
/// fn main() {
Copy link
Member

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?

Copy link
Member

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:

/// ```
/// #![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);
/// ```

Copy link
Member Author

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.

@frewsxcv
Copy link
Member

📝 🎊

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 30, 2016

📌 Commit 336e5dd has been approved by frewsxcv

dns2utf8 added a commit to dns2utf8/rust that referenced this pull request Dec 1, 2016
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Dec 3, 2016
bors added a commit that referenced this pull request Dec 3, 2016
Rollup of 15 pull requests

- Successful merges: #37859, #37919, #38020, #38028, #38029, #38065, #38073, #38077, #38089, #38090, #38096, #38112, #38113, #38130, #38141
- Failed merges:
@bors bors merged commit 336e5dd into rust-lang:master Dec 4, 2016
@GuillaumeGomez GuillaumeGomez deleted the ipaddr_doc branch December 4, 2016 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants