Skip to content

Conversation

@alexcrichton
Copy link
Member

These commits create a Buffer trait in the io module which represents an I/O reader which is internally buffered. This abstraction is used to reasonably implement read_line and read_until along with at least an ok implementation of read_char (although I certainly haven't benchmarked read_char).

This trait is meant to abstract whether a reader is actually implemented with an
underlying buffer. For all readers which are implemented as such, we can
efficiently implement things like read_char, read_line, read_until, etc. There
are two required methods for managing the internal buffer, and otherwise
read_line and friends can all become default methods.

Closes rust-lang#10334
@alexcrichton
Copy link
Member Author

This also implements the Buffer trait for the BufferedStream, BufReader, and MemReader types (as one would expect).

bors added a commit that referenced this pull request Nov 17, 2013
These commits create a `Buffer` trait in the `io` module which represents an I/O reader which is internally buffered. This abstraction is used to reasonably implement `read_line` and `read_until` along with at least an ok implementation of `read_char` (although I certainly haven't benchmarked `read_char`).
@bors bors closed this Nov 17, 2013
@bors bors merged commit 01343d3 into rust-lang:master Nov 17, 2013
@alexcrichton alexcrichton deleted the issue-10334 branch November 19, 2013 07:06
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 10, 2023
Add the `popular-crates` binary

This program downloads crates info from <https://crates.io/> and builds a TOML file that can be fed to `lintcheck`.

I have been asked, on various pull requests, what the result of `lintcheck` was. However, the default configuration file for lintcheck is limited. This `popular-crates` program allows building a recent list of the recently most downloaded crates from <https://crates.io> and feed it to `lintcheck`. Using it, it was easy to test two new lints against the 500 recently most downloaded crates to ensure that there was no regression.

changelog: none
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.

2 participants