about summary refs log tree commit diff
path: root/src/libstd/io
AgeCommit message (Collapse)AuthorLines
2017-03-24Document Cursor::new position is 0Stepan Koltsov-0/+4
... even if contained `Vec` is not empty. E. g. for ``` let v = vec![10u8, 20]; let mut c = io::Cursor::new(v); c.write_all(b"aaaa").unwrap(); println!("{:?}", c.into_inner()); ``` result is ``` [97, 97, 97, 97] ``` and not ``` [10, 20, 97, 97, 97, 97] ```
2017-03-23newline for breathing roomNick Sweeting-0/+1
2017-03-23requested changesNick Sweeting-1/+2
2017-03-23Add helpful hint on io function for beginnersNick Sweeting-0/+10
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-53/+53
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-01Only keep one copy of the UTF8_CHAR_WIDTH table.Simon Sapin-1/+1
… instead of one of each of libcore and libstd_unicode. Move the `utf8_char_width` function to `core::str` under the `str_internals` unstable feature.
2017-02-16std::io::cursor: Fixed Seek so test passes.Amos Onn-10/+12
2017-02-16std::io::cursor Added test for seeking beyond i64.Amos Onn-0/+37
2017-01-29Fix a few impl stability attributesOliver Middleton-10/+10
The versions show up in rustdoc.
2017-01-22libstd: mention `?` operator instead of removing `try!` macro referenceUtkarsh Kukreti-1/+3
2017-01-22libstd: update std::io module documentation to not mention `try!`Utkarsh Kukreti-3/+1
We're not using it in the examples anymore.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-89/+89
See #38644.
2017-01-13Change `to_owned` to `to_string` in docsStjepan Glavina-2/+2
We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
2016-12-24Rollup merge of #38505 - estebank:why-lines, r=frewsxcvSteve Klabnik-0/+6
Docs: Explain why/when `.lines()` returns an error Fix #37744.
2016-12-24Auto merge of #38062 - alexcrichton:fix-line-writer, r=brsonbors-13/+86
std: Fix partial writes in LineWriter 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-12-20Docs: Explain why/when `.lines()` returns an errorEsteban Küber-0/+6
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+79
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-16Address falloutAaron Turon-3/+3
2016-12-15Stabilize std::io::Take::into_innerAaron Turon-3/+1
2016-12-12Merge branch 'master' into redoxJeremy Soller-3/+21
2016-12-12Auto merge of #38049 - frewsxcv:libunicode, r=alexcrichtonbors-1/+1
Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes https://github.com/rust-lang/rust/issues/26554.
2016-11-30Move small-copy optimization into <&[u8] as Read>Ruud van Asseldonk-2/+20
Based on the discussion in https://github.com/rust-lang/rust/pull/37573, it is likely better to keep this limited to std::io, instead of modifying a function which users expect to be a memcpy.
2016-11-30Move small-copy optimization into copy_from_sliceRuud van Asseldonk-15/+3
Ultimately copy_from_slice is being a bottleneck, not io::Cursor::read. It might be worthwhile to move the check here, so more places can benefit from it.
2016-11-30Add small-copy optimization for io::CursorRuud van Asseldonk-3/+15
During benchmarking, I found that one of my programs spent between 5 and 10 percent of the time doing memmoves. Ultimately I tracked these down to single-byte slices being copied with a memcopy in io::Cursor::read(). Doing a manual copy if only one byte is requested can speed things up significantly. For my program, this reduced the running time by 20%. Why special-case only a single byte, and not a "small" slice in general? I tried doing this for slices of at most 64 bytes and of at most 8 bytes. In both cases my test program was significantly slower.
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-1/+1
Fixes #26554.
2016-11-28Move stdout/err flush into sysJeremy Soller-6/+0
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-19Merge branch 'master' into redoxJeremy Soller-1/+4
2016-11-10Merge branch 'master' into redoxJeremy Soller-34/+74
2016-11-10Fixes for stdio and processes on RedoxJeremy Soller-0/+6
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-11-08Rollup merge of #37588 - GuillaumeGomez:missing_io_urls, r=frewsxcvSteve Klabnik-11/+19
Add missing urls on io structs r? @steveklabnik
2016-11-05Rollup merge of #37537 - GuillaumeGomez:error_kind_doc, r=steveklabnikAlex Crichton-2/+7
Add missing urls for ErrorKind's variants r? @steveklabnik
2016-11-05add missing urls on io structsGuillaume Gomez-11/+19
2016-11-04Auto merge of #37037 - Mark-Simulacrum:stack-error, r=alexcrichtonbors-21/+48
Add conversions from `io:ErrorKind` to `io::Error` Filing to help with discussion around the possibility of doing this. Current changes are clearly backwards incompatible, but I think adding a new function (with a bikeshed on naming) like `Error::new_str` should be possible (or some other way of specializing the string error message case) to fix #36658.
2016-11-02Add missing urls for ErrorKind's variantsGuillaume Gomez-2/+7
2016-11-02Auto merge of #36948 - brson:sys, r=brsonbors-10/+2
More refactoring to obey platform abstraction lint The most interesting things here are moving `std/sys/common` to `std/sys_common`, and `std/num/{f32,f64}.rs` to `std/{f32,f64}.rs`, and adding more documentation to `std/lib.rs`. r? @alexcrichton
2016-11-02Add a new non-heap allocated variant to io::Error's representation.Mark-Simulacrum-21/+48
Implement From<ErrorKind> for io::Error, intended for use with errors that should never be exposed to the user.
2016-11-01std: Move a plattform-specific constant to sys::stdioBrian Anderson-10/+2
2016-11-01Rollup merge of #37316 - ollie27:docs_links, r=GuillaumeGomezGuillaume Gomez-2/+2
Fix a few links in the docs r? @steveklabnik
2016-10-31Changed most vec! invocations to use square bracesiirelu-6/+6
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-27Add documentation for Read, Write impls for slices and VecUlrik Sverdrup-0/+11
The Write impls for &[u8] and Vec<u8> are quite different, and we need this to be reflected in the docs. These documentation comments will be visible on the respective type's page in the trait impls section.
2016-10-21Fix a few links in the docsOliver Middleton-2/+2
2016-10-19Rollup merge of #37165 - GuillaumeGomez:bytes_url, r=kmcallisterGuillaume Gomez-6/+12
Add missing urls for io types r? @steveklabnik
2016-10-18Typos in some linkageGuillaume Gomez-41/+52
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-14Add missing urls for io typesGuillaume Gomez-6/+12
2016-10-12Rollup merge of #37089 - GuillaumeGomez:io_urls, r=frewsxcvAlex Crichton-32/+37
Add missing urls in io module 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)