Skip to content

Remove unnecessarily mutable reference in doc example. #34717

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

Merged
merged 1 commit into from
Jul 9, 2016

Conversation

frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Jul 8, 2016

No description provided.

@@ -155,6 +155,7 @@ pub struct Sink { _priv: () }
/// let mut buffer = vec![1, 2, 3, 5, 8];
/// let num_bytes = io::sink().write(&mut buffer).unwrap();
/// assert_eq!(num_bytes, 5);
/// assert_eq!(buffer, &[1, 2, 3, 5, 8]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead of this, just change the example so it doesn't mutably borrow the buffer?

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely a good idea. Just made that change.

@frewsxcv frewsxcv changed the title Indicate that std::io::sink does not affect the data. Remove unnecessarily mutable reference in doc example. Jul 8, 2016
@apasel422
Copy link
Contributor

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 8, 2016

📌 Commit fc2123a has been approved by apasel422

@bors
Copy link
Collaborator

bors commented Jul 9, 2016

⌛ Testing commit fc2123a with merge d40c593...

bors added a commit that referenced this pull request Jul 9, 2016
Remove unnecessarily mutable reference in doc example.

None
@bors bors merged commit fc2123a into rust-lang:master Jul 9, 2016
@frewsxcv frewsxcv deleted the sink branch October 2, 2016 23:06
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.

4 participants