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

Documentation change: Now showing the difference between map and and_then with an example. #30971

Merged
merged 3 commits into from
Feb 2, 2016

Conversation

sandeep-datta
Copy link
Contributor

Updated documentation to clarify the difference between and_then and map. This also explains why we need and_then in addition to map. Please look at the diff for more information.

r? @alexcrichton

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Thanks! Could you also wrap the lines to 80 chars (appears to be the surrounding style). For the actual content, though:

r? @steveklabnik

@sandeep-datta
Copy link
Contributor Author

I just felt the manually inserted 80 char wide line breaks are an anachronism in this day and age. Almost all editors can do word wrapping now. The reader should be given a choice of where they want to see the line breaks instead of making this decision for them. IMO line breaks should only be used to delineate paragraphs.

Also I think unnecessary hard line breaks will make whitespace significant during file merge/comparison and make it unnecessarily hard to contribute. For example you might overflow the 80 char limit when adding a word to a line and end up with a cascading change which affects multiple lines thus making it difficult to see what was actually changed. There may be other complications arising out of this decision.

I vote for removing hard line breaks from the document altogether. But I do not want to upset the apple cart on the other hand so please let me know if you would like to go with ...

  1. Removing hard line breaks from the whole document or...
  2. Uniformly breaking lines at the 80 char limit (for my changes only).

@alexcrichton
Copy link
Member

Er sorry but this is just the style we use, changing it isn't really within the scope of this PR.

@sandeep-datta
Copy link
Contributor Author

@alexcrichton, changed to 80 char column now.

@steveklabnik
Copy link
Member

@bors: r+ rollup

Thank you!

@bors
Copy link
Collaborator

bors commented Jan 20, 2016

📌 Commit 5f20143 has been approved by steveklabnik

@bors
Copy link
Collaborator

bors commented Jan 23, 2016

⌛ Testing commit 5f20143 with merge 1998e3a...

@bors
Copy link
Collaborator

bors commented Jan 23, 2016

💔 Test failed - auto-mac-64-nopt-t

implementation is even simpler than `map`:
analysis, but its type doesn't quite fit...

```rust
Copy link
Member

Choose a reason for hiding this comment

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

this needs to be marked ignore as well, so that it doesn't get tested.

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jan 23, 2016
Updated documentation to clarify the difference between `and_then` and `map`. This also explains why we need `and_then` in addition to `map`. Please look at the diff for more information.

r?  @alexcrichton
@steveklabnik
Copy link
Member

@bors: r-

@sandeep-datta
Copy link
Contributor Author

@steveklabnik please review and commit.

@steveklabnik
Copy link
Member

@bors: r+ rollup

thank you!

@bors
Copy link
Collaborator

bors commented Feb 1, 2016

📌 Commit 0922d7e has been approved by steveklabnik

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Feb 1, 2016
Updated documentation to clarify the difference between `and_then` and `map`. This also explains why we need `and_then` in addition to `map`. Please look at the diff for more information.

r?  @alexcrichton
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Feb 2, 2016
Updated documentation to clarify the difference between `and_then` and `map`. This also explains why we need `and_then` in addition to `map`. Please look at the diff for more information.

r?  @alexcrichton
bors added a commit that referenced this pull request Feb 2, 2016
@bors bors merged commit 0922d7e into rust-lang:master Feb 2, 2016
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.

5 participants