Skip to content

Unix socket doc#38236

Merged
bors merged 5 commits into
rust-lang:masterfrom
GuillaumeGomez:unix_socket_doc
Dec 21, 2016
Merged

Unix socket doc#38236
bors merged 5 commits into
rust-lang:masterfrom
GuillaumeGomez:unix_socket_doc

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This example doesn't seem particularly helpful :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh damn!

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

@nagisa nagisa Dec 8, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMHO every single example exhaustively matching on socket creation is sort of overzealous.

if let Ok(socket) = UnixListener::bind("/tmp/sock") {
     // show off the feature
}

would be a much better alternative IMO.

EDIT: exhaustive matching is fine on the examples of functions that do the actual socket creation, though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think I'll just go for unwrap for the other cases.

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unused variable :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't see it as an issue here, on the opposite. The point is to show people how it works, and creating a (unused) variable helps it.

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

@nagisa nagisa Dec 8, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Couldn’t create a pair of sockets.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Updated.

@GuillaumeGomez GuillaumeGomez force-pushed the unix_socket_doc branch 2 times, most recently from 477ba42 to fdbd760 Compare December 9, 2016 06:28
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

And urls fixed as well. Build fails but doesn't have errors so I guess it's okay?

@frewsxcv frewsxcv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, just a few comments 🎊

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: 'nonblocking' is one word

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: why is "AU" capitalized?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To help english people improve their french. :p

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For me, a person who doesn't know any French, it doesn't help me learn French, it just makes me confused :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Haha. Well, I'll "fixed" it then.

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ditto "AU"

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add an example here where is_unnamed() is true?

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here. If we can create an unnamed socket, can we show here that as_pathname() is None?

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Updated.

@frewsxcv frewsxcv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

r=me unless you want to address the nits

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Alternatively, you could also do something like this:

# Examples

An unnamed address:

```
...
```

A named address:

```
...
```

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh good point!

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: The ellipsis here doesn't seem necessary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The ellipsis? What do you mean? The expect call?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

I addressed the nits.

Comment thread src/libstd/sys/unix/ext/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you want to do the same thing here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh indeed!

@frewsxcv

Copy link
Copy Markdown
Contributor

r=me unless you want to address that comment

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

And updated too.

@frewsxcv

Copy link
Copy Markdown
Contributor

@bors r+ rollup 🎉

@bors

bors commented Dec 13, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit cc180fb has been approved by frewsxcv

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 15, 2016
@frewsxcv

Copy link
Copy Markdown
Contributor

@bors r-

Errors: #38387 (comment)

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

And fixed. I re-r+ if you don't mind @frewsxcv.

@bors: r=frewsxcv

@bors

bors commented Dec 16, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 2938e6a has been approved by frewsxcv

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 16, 2016
@bors

bors commented Dec 16, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 2938e6a with merge 1ca362c...

@bors

bors commented Dec 16, 2016

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-mac-64-opt-rustbuild

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@bors: retry

@bors

bors commented Dec 16, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 2938e6a with merge 92039a2...

@bors

bors commented Dec 16, 2016

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-mac-64-opt-rustbuild

@alexcrichton

alexcrichton commented Dec 16, 2016 via email

Copy link
Copy Markdown
Member

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 18, 2016
@sanxiyn

sanxiyn commented Dec 19, 2016

Copy link
Copy Markdown
Contributor

@bors retry

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 20, 2016
bors added a commit that referenced this pull request Dec 20, 2016
@bors bors merged commit 2938e6a into rust-lang:master Dec 21, 2016
@GuillaumeGomez GuillaumeGomez deleted the unix_socket_doc branch December 21, 2016 16:37
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.

6 participants