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 read_to_str and write_{str, line} #10861

Merged
merged 1 commit into from
Jan 3, 2014
Merged

Conversation

alexcrichton
Copy link
Member

These methods are sorely needed on readers and writers, and I believe that the
encoding story should be solved with composition. This commit adds back the
missed functions when reading/writing strings onto generic Readers/Writers.

/// # Failure
///
/// This function will raise all the same conditions as the `read` method,
/// along with raising a condition if the input is not valid utf-8.
Copy link
Member

Choose a reason for hiding this comment

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

The capitalisation of utf-8 is inconsistent.

@Dretch
Copy link
Contributor

Dretch commented Dec 27, 2013

Bump.

I would love to have these methods back. I was using them before they disappeared, and the documentation in std::io makes reference to them.

@pcwalton
Copy link
Contributor

pcwalton commented Jan 2, 2014

Agreed with @huonw. r=me with those changes.

These methods are sorely needed on readers and writers, and I believe that the
encoding story should be solved with composition. This commit adds back the
missed functions when reading/writing strings onto generic Readers/Writers.
bors added a commit that referenced this pull request Jan 3, 2014
These methods are sorely needed on readers and writers, and I believe that the
encoding story should be solved with composition. This commit adds back the
missed functions when reading/writing strings onto generic Readers/Writers.
@bors bors merged commit a2a6720 into rust-lang:master Jan 3, 2014
@Dretch
Copy link
Contributor

Dretch commented Jan 3, 2014

@alexcrichton

Thanks for fixing this. I have just noticed that there also used to be write_char method in addition to write_str and write_line. Would it be possible to restore this too (there is already a read_char)?

@alexcrichton alexcrichton deleted the iostr branch January 3, 2014 18:24
@alexcrichton
Copy link
Member Author

Ah I guess I missed that! Pull requests are welcome though! I'll see if I can get around to it soon.

@Dretch
Copy link
Contributor

Dretch commented Jan 3, 2014

I will try and send a pull request in the next day or two.

Dretch added a commit to Dretch/rust that referenced this pull request Jan 4, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
new lint [`single_call_fn`]

Closes rust-lang#10861

changelog: New lint [`single_call_fn`]
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