about summary refs log tree commit diff
path: root/src/libstd/io/buffered.rs
AgeCommit message (Collapse)AuthorLines
2018-11-02Fix compile errors in testJonathan Behrens-9/+9
2018-11-02Suggested editsJonathan Behrens-24/+24
2018-11-02Add some testsJonathan Behrens-11/+20
2018-11-02Add BufWriter::buffer methodJonathan Behrens-0/+19
2018-09-06Fix invalid urlsGuillaume Gomez-4/+2
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-07-30Remove unstable and deprecated APIsSimon Sapin-46/+0
2018-07-26State default capacity for BufReader/BufWriterJonathan Behrens-2/+4
2018-07-11simplify assertionsAndy Russell-5/+4
2018-07-08rework `LineWriter` exampleAndy Russell-10/+24
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.
2018-04-15Deprecate Read::chars and char::decode_utf8Simon Sapin-0/+2
Per FCP: * https://github.com/rust-lang/rust/issues/27802#issuecomment-377537778 * https://github.com/rust-lang/rust/issues/33906#issuecomment-377534308
2018-04-05Rollup merge of #49594 - mbrubeck:docs, r=steveklabnikkennytm-0/+12
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.
2018-04-03Add performance notes to BufReader/BufWriter docsMatt Brubeck-0/+12
2018-04-02Fix typoRolf van de Krol-1/+1
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-109/+110
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-03-18Add BufReader::bufferSteven Fackler-1/+29
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.
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2018-01-15Rollup merge of #47330 - bmusin:patch-2, r=shepmasterkennytm-4/+4
fix off-by-one error Fixes https://github.com/rust-lang/rust/issues/47325.
2018-01-14Auto merge of #46832 - Diggsey:bufread-cheaper-seek, r=alexcrichtonbors-0/+46
BufRead: Only flush the internal buffer if seeking outside of it. Fixes #31100 r? @dtolnay
2018-01-13Add note to documentationDiggory Blake-0/+4
2018-01-13Implement "seek_relative"Diggory Blake-0/+42
2018-01-13fix off-by-one errorBulat Musin-4/+4
2018-01-02Document when LineWriter flushes; document errors for into_inner.Corey Farwell-0/+11
Fixes https://github.com/rust-lang/rust/issues/42468.
2017-12-21docs: do not call integer overflows as underflowsTrevor Spiteri-1/+1
2017-10-18Implement is_empty() for BufReaderJonathan Behrens-0/+25
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-07-20Remove mut where possibleEvan Cameron-10/+10
2017-07-09Add warning to BufWriter documentationJohn Gallagher-1/+5
2017-06-20Add `Read::initializer`.Steven Fackler-6/+16
This is an API that allows types to indicate that they can be passed buffers of uninitialized memory which can improve performance.
2017-04-06Fix Markdown issues in the docsOliver Middleton-8/+9
* 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.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-16/+16
See #38644.
2016-11-28std: Fix partial writes in LineWriterAlex Crichton-13/+86
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
2016-11-10Remove one bounds check from BufReaderArthur Silva-1/+4
Otherwise the optimizer can't be sure that pos <= cap. Added a paranoid debug_assert to ensure correctness instead.
2016-10-14Rollup merge of #37115 - GuillaumeGomez:buf_reader_urls, r=kmcallisterJonathan Turner-5/+13
add missing urls for BufWriter and BufReader r? @steveklabnik
2016-10-12add missing urls for BufWriter and BufReaderGuillaume Gomez-5/+13
2016-10-12Deprecate `Reflect`Nick Cameron-2/+1
[tracking issue](https://github.com/rust-lang/rust/issues/27749)
2016-10-05Fixed small typo in `BufRead` commentsRazican-1/+1
`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.
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+1
2016-09-21Fix outdated Doc Comment on BufReader::seekChristopher Serr-2/+2
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.
2016-09-11Remove unnecessary `cmp::min` from BufWriter::writeRichard Janis Goldschmidt-2/+1
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`.
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-2/+0
2016-05-09Utilize `Result::unwrap_err` in more places.Corey Farwell-1/+1
2016-03-22try! -> ?Jorge Aparicio-9/+9
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
2016-03-07Add test case for #32085Steven Allen-0/+28
2016-03-07Never return an error after a partial writeSteven Allen-2/+4
If LineWriter fails to flush, return the number of bytes written instead of an error. Fixes #32085
2016-01-26Fix warnings during testsAlex Crichton-2/+2
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
2016-01-22Auto merge of #31070 - sfackler:bufreader-box-slice, r=alexcrichtonbors-2/+2
Saves a word, and also prevents the impl from accidentally changing the buffer length. r? @alexcrichton
2016-01-20Use a Box<[u8]> in BufReaderSteven Fackler-2/+2
Saves a word, and also prevents the impl from accidentally changing the buffer length.
2016-01-20Don't flush in BufWriter destructor after a panic in writeSteven Fackler-3/+40
We don't want to write the same data twice. Closes #30888
2016-01-12Remove dead `InternalBufWriter` implementationAndrea Canciani-15/+0
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.