Skip to content

Improve docs around File and BufReader #35875

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

Closed
steveklabnik opened this issue Aug 21, 2016 · 5 comments
Closed

Improve docs around File and BufReader #35875

steveklabnik opened this issue Aug 21, 2016 · 5 comments

Comments

@steveklabnik
Copy link
Member

Part of #29356 and related to #29300

Inspired by https://www.reddit.com/r/rust/comments/4yinbt/writing_a_jpeg_decoder_in_rust_part_2/d6obhd8?st=is4wut7k&sh=6d31802c

BufReader's talks about why you'd need it, but it's not super clear from File, which is more likely how people will discover this stuff. We should make sure people using File as a Read understand things here.

@marti1125
Copy link
Contributor

Hi @steveklabnik I would like contribute with this =D

@steveklabnik
Copy link
Member Author

@marti1125 awesome! Please let me know if you need any help

@marti1125
Copy link
Contributor

Hi @steveklabnik could you give some step how to improve this documentation please

@steveklabnik
Copy link
Member Author

Hey @marti1125:

So, the main issue here is explaining in File's docs why you might want to pair the File with BufReader. I would approach this in two steps:

  1. Mention in File's docs that you might want to combine it with BufReader, and link to Bufreader's docs
  2. update BufReader's docs to be a little more clear about what's going on. It's very terse at the moment.

Does that make sense?

@frewsxcv
Copy link
Member

Opened a PR that addresses this: #38443.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Dec 18, 2016
* Separate functionality into different code blocks
* Incorporate `BufReader` example
 * Fixes rust-lang#35875.
bors added a commit that referenced this issue Dec 24, 2016
Improve the API examples for `std::fs::File`.

Fixes #35875.
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

No branches or pull requests

3 participants