| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The original example didn't check the return value of `write()`, didn't
flush the writer, and didn't properly demonstrate the buffering.
Fixes #51621.
|
|
Per FCP:
* https://github.com/rust-lang/rust/issues/27802#issuecomment-377537778
* https://github.com/rust-lang/rust/issues/33906#issuecomment-377534308
|
|
Add some performance guidance to std::fs and std::io docs
Adds more documentation about performance to various "read" functions in `fs` and `io`, and to `BufReader`/`BufWriter`, with the goal of helping developers choose the best option for a given task.
|
|
|
|
|
|
Fixes https://github.com/rust-lang/rust/issues/49233.
|
|
This subsumes the need for an explicit is_empty function, and provides
access to the buffered data itself which has been requested from time to
time.
|
|
|
|
fix off-by-one error
Fixes https://github.com/rust-lang/rust/issues/47325.
|
|
BufRead: Only flush the internal buffer if seeking outside of it.
Fixes #31100
r? @dtolnay
|
|
|
|
|
|
|
|
Fixes https://github.com/rust-lang/rust/issues/42468.
|
|
|
|
|
|
Like #43008 (f668999), but _much more aggressive_.
|
|
|
|
|
|
This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.
|
|
* Since the switch to pulldown-cmark reference links need a blank line
before the URLs.
* Reference link references are not case sensitive.
* Doc comments need to be indented uniformly otherwise rustdoc gets
confused.
|
|
See #38644.
|
|
Previously the `LineWriter` could successfully write some bytes but then fail to
report that it has done so. Additionally, an erroneous flush after a successful
write was permanently ignored. This commit fixes these two issues by (a)
maintaining a `need_flush` flag to indicate whether a flush should be the first
operation in `LineWriter::write` and (b) avoiding returning an error once some
bytes have been successfully written.
Closes #37807
|
|
Otherwise the optimizer can't be sure that pos <= cap. Added a paranoid debug_assert to ensure correctness instead.
|
|
add missing urls for BufWriter and BufReader
r? @steveklabnik
|
|
|
|
[tracking issue](https://github.com/rust-lang/rust/issues/27749)
|
|
`BufRead` comments, in the `Seek` trait implementation, was talking
about allocating 8 *ebibytes*. It was a typo, the correct unit is
*exbibytes*, since *ebibytes* don't even exist. The calculation is
correct, though.
|
|
|
|
A long time ago non-panicking `unwrap` methods were renamed to `into_inner` in this Pull Request: https://github.com/rust-lang/rust/pull/19149
Looks like this doc comment was not updated however.
|
|
The first branch of the if statement already checks if `buf.len() >= self.buf.capacity()`, which makes the `cmp::min(buf.len(), self.buf.capacity())` redundant: the result will always be `buf.len()`. Therefore, we can pass the `buf` slice directly into `Write::write`.
|
|
|
|
|
|
Automated conversion using the untry tool [1] and the following command:
```
$ find -name '*.rs' -type f | xargs untry
```
at the root of the Rust repo.
[1]: https://github.com/japaric/untry
|
|
|
|
If LineWriter fails to flush, return the number of bytes written instead
of an error.
Fixes #32085
|
|
The deny(warnings) attribute is now enabled for tests so we need to weed out
these warnings as well.
|
|
Saves a word, and also prevents the impl from accidentally changing the
buffer length.
r? @alexcrichton
|
|
Saves a word, and also prevents the impl from accidentally changing the
buffer length.
|
|
We don't want to write the same data twice.
Closes #30888
|
|
In 8d90d3f36871a00023cc1f313f91e351c287ca15 `BufStream`, the only
consumer of `InternalBufWriter`, was removed. As implied by the name,
this type is private, hence it is currently dead code.
|