summary refs log tree commit diff
path: root/src/libstd/io/buffered.rs
AgeCommit message (Collapse)AuthorLines
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.
2015-12-29Fix warnings when compiling stdlib with --testFlorian Hahn-1/+1
2015-12-18Use memchr in libstd where possible, closes #30076Florian Hahn-1/+2
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+1
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-148/+1
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-07-29Rollup merge of #27341 - steveklabnik:remove_warning, r=alexcrichtonSteve Klabnik-4/+0
This isn't a standard header, and the other docs don't use it, so let's remove it.
2015-07-27Remove warning header for consistencySteve Klabnik-4/+0
This isn't a standard header, and the other docs don't use it, so let's remove it.
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-1/+1
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-22Rollup merge of #27170 - steveklabnik:doc_std_io_intoinnererror, r=alexcrichtonSteve Klabnik-1/+73
Mostly adding examples. r? @alexcrichton
2015-07-22Rollup merge of #27166 - steveklabnik:doc_std_io_linewriter, r=alexcrichtonSteve Klabnik-3/+120
Beef up the struct docs, add examples for the methods. r? @alexcrichton
2015-07-22Improve documentation for std::io::LineWriterSteve Klabnik-3/+120
Beef up the struct docs, add examples for the methods.
2015-07-22Improve documentation for std::io::BufWriterSteve Klabnik-5/+97
Mostly through adding examples.
2015-07-21Expand documentation for IntoInnerErrorSteve Klabnik-1/+73
Mostly adding examples.
2015-07-14Use Vec::drain in BufWriterUlrik Sverdrup-8/+1
I happened past a comment that asked for functionality that we now have.