| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This method was not really useful: at no point one would only need to
read the initialized part of the cursor without mutating it.
|
|
|
|
docs: Small clarification on the usage of read_to_string and read_to_end trait methods
Small clarification on the usage of read_to_string and read_to_end trait methods. The goal is to make it clear that these trait methods will become locked up if attempting to read to the end of stdin (which is a bit non-sensical unless the other end closes the pipe).
Fixes: rust-lang/rust#141714
|
|
trait methods
|
|
It can only describe the inner workings of the default implementation,
other implementations might not be implemented using seeks at all.
|
|
It uses the file metadata on Unix with a fallback for files incorrectly
reported as zero-sized. It uses `GetFileSizeEx` on Windows.
This reduces the number of syscalls needed for determining the file size
of an open file from 3 to 1.
|
|
|
|
|
|
The methods `Take::get_mut` and `Chain::get_mut` include comments
warning about modifying the I/O state of the underlying reader. However,
many readers (e.g. `File`) allow I/O using a shared reference (e.g.
`&File`). So, add the same caveat to the `get_ref` methods.
|
|
|
|
|
|
Optimize `io::Write::write_fmt` for constant strings
When the formatting args to `fmt::Write::write_fmt` are a statically known string, it simplifies to only calling `write_str` without a runtime branch. Do the same in `io::Write::write_fmt` with `write_all`.
Also, match the convention of `fmt::Write` for the name of `args`.
|
|
clarify BufRead::{fill_buf, consume} docs
Fixes #85394
|
|
Co-authored-by: Ibraheem Ahmed <ibraheem@ibraheem.ca>
|
|
When the formatting args to `fmt::Write::write_fmt` are a statically
known string, it simplifies to only calling `write_str` without a
runtime branch. Do the same in `io::Write::write_fmt` with `write_all`.
Also, match the convention of `fmt::Write` for the name of `args`.
|
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
with where to *actually* look for more details
|
|
This will be used in Clippy to detect unbuffered calls to
`Read::bytes()`.
|
|
|
|
Fixes #85394
|
|
|
|
- Simplify some of the language
- Minor grammar fixes
- Don't imply that pipes *only* work across multiple processes; instead,
*suggest* that they're typically used across two or more separate
processes.
- Specify that portable applications cannot use multiple readers or
multiple writers for messages larger than a byte, due to potential
interleaving.
- Remove no-longer-referenced footnote URLs.
|
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
|
|
ACP: rust-lang/libs-team#205
Tracking issue: #133448
|
|
Co-authored-by: Mike Pedersen <mike@mikepedersen.dk>
Co-authored-by: Nathan West <Lucretiel@gmail.com>
|
|
(cherry picked from commit 567fd9610cbfd220844443487059335d7e1ff021)
|
|
|
|
|
|
|
|
|
|
|
|
for disk IO:
1st short read = probably at end of file
2nd short read = confirming that it's indeed EOF
|
|
|
|
Bump bootstrap compiler to new beta
https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
|
|
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
|
|
|
|
Many tiny changes to stdlib doc comments to make them consistent (for example
"Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph
breaks, backticks for monospace style, and other minor nits.
https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
|
|
|
|
This provides a list of locations to hunt down issues in.
|
|
|
|
|
|
Stabilize `seek_seek_relative`
This PR stabilizes `seek_seek_relative`:
```rust
// std::io::Seek
trait Seek {
fn seek_relative(&mut self, offset: i64) -> Result<()>;
}
```
<br>
Tracking issue: https://github.com/rust-lang/rust/issues/117374.
Implementation PR: https://github.com/rust-lang/rust/pull/116750.
FCPs already completed in the tracking issue.
Closes https://github.com/rust-lang/rust/issues/117374.
r? libs-api
|
|
|
|
Improve several `Read` implementations
- `read_to_end` and `read_to_string` for `Cursor`
- Error on OOM in `read_to_string` of `&[u8]` and `VecDeque<u8>`
- Avoid making the slices contiguous in `VecDeque::read_to_string`
- ~`read_exact` and (unstable) `read_buf_exact` for `Take`~
- ~`read_buf` for `UnixStream` and `&UnixStream`~ (moved to #123084)
- `read_to_end` for `ChildStdErr`
|
|
|
|
|
|
Avoid a panic in `set_output_capture` in the default panic handler
This avoid a panic in the default panic handler by not using `set_output_capture` as `OUTPUT_CAPTURE.with` may panic once `OUTPUT_CAPTURE` is dropped.
A new non-panicking `try_set_output_capture` variant of `set_output_capture` is added for use in the default panic handler.
|
|
|