about summary refs log tree commit diff
path: root/src/libcore/io.rs
AgeCommit message (Collapse)AuthorLines
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-2105/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-20auto merge of #6635 : brson/rust/snapshot, r=brsonbors-44/+0
2013-05-19Register snapshotsBrian Anderson-44/+0
2013-05-19auto merge of #6621 : steveklabnik/rust/expand_reader_docs, r=thestingerbors-3/+13
Had a conversation with @cmr in IRC about some places that these docs were confusing. The functions that advance the stream now say so. In addition, I think that calling out the similarities to familliar C functions should help people coming from other languages.
2013-05-19Add a few 'function's.Steve Klabnik-2/+2
This is now 100% consistent. Whoops!
2013-05-19auto merge of #6624 : steveklabnik/rust/io_prelude, r=catamorphismbors-1/+31
Let's actually give a top-level description of what's in here, eh?
2013-05-19Fix wording per feedbackSteve Klabnik-2/+2
Thanks @catamorphism!
2013-05-19Add a better introduction for the io module.Steve Klabnik-1/+31
Let's actually give a top-level description of what's in here, eh?
2013-05-19auto merge of #6619 : steveklabnik/rust/stdout_docs, r=thestingerbors-0/+44
Added docs for stdout, stderr, print, and println.
2013-05-19Fix trailing whitespaceSteve Klabnik-2/+2
2013-05-19Elaborate a bit in the Reader docs regarding stream position.Steve Klabnik-3/+13
Had a conversation with @cmr in IRC about some places that these docs were confusing. The functions that advance the stream now say so. In addition, I think that calling out the similarities to familliar C functions should help people coming from other languages.
2013-05-19Added note about prelude inclusion.Steve Klabnik-2/+4
2013-05-19Add docs for stdin in core::io.Steve Klabnik-0/+10
2013-05-19Add additional documentation in core::io.Steve Klabnik-0/+42
Added docs for stdout, stderr, print, and println.
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-17/+17
2013-05-15Rename vec::len(var) to var.len()Youngmin Yoo-6/+6
2013-05-13Remove re-exports from libcore/core.rcAlex Crichton-0/+5
Also fix up all the fallout elsewhere throughout core. It's really nice being able to have the prelude.
2013-05-11auto merge of #6389 : sonwow/rust/issue-3356, r=bstriebors-1/+1
Fix for #3356
2013-05-10renamed str::from_slice to str::to_ownedYoungsoo Son-1/+1
2013-05-10core: Use the new `for` protocolAlex Crichton-0/+47
2013-05-09libcore: rename vec::each(variable) to variable.eachYoungmin Yoo-1/+1
2013-05-08libcore: Fix tests.Patrick Walton-3/+3
2013-05-08librustc: Fix merge fallout.Patrick Walton-5/+8
2013-05-08libcore: Remove more mutable fields from commPatrick Walton-34/+68
2013-05-08io: handle fread() errorsFedor Indutny-2/+12
When, occasionally, trying to read directory instead of file, `fread()` returns `EISDIR` error. And, considering, absence of error handling, `read_whole_stream()` just loops indefinitely.
2013-05-05Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-10/+0
Conflicts: src/libcore/core.rc src/libcore/hashmap.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/num/float.rs src/libcore/num/int-template.rs src/libcore/num/num.rs src/libcore/num/strconv.rs src/libcore/num/uint-template.rs src/libcore/ops.rs src/libcore/os.rs src/libcore/prelude.rs src/libcore/rt/mod.rs src/libcore/unstable/lang.rs src/librustc/driver/session.rs src/librustc/middle/astencode.rs src/librustc/middle/borrowck/check_loans.rs src/librustc/middle/borrowck/gather_loans.rs src/librustc/middle/borrowck/loan.rs src/librustc/middle/borrowck/preserve.rs src/librustc/middle/liveness.rs src/librustc/middle/mem_categorization.rs src/librustc/middle/region.rs src/librustc/middle/trans/base.rs src/librustc/middle/trans/inline.rs src/librustc/middle/trans/reachable.rs src/librustc/middle/typeck/check/_match.rs src/librustc/middle/typeck/check/regionck.rs src/librustc/util/ppaux.rs src/libstd/arena.rs src/libstd/ebml.rs src/libstd/json.rs src/libstd/serialize.rs src/libstd/std.rc src/libsyntax/ast_map.rs src/libsyntax/parse/parser.rs src/test/compile-fail/borrowck-uniq-via-box.rs src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs src/test/run-pass/borrowck-nested-calls.rs
2013-05-02Remove 'Local Variable' commentsBrendan Zabarauskas-10/+0
2013-04-30new borrow checker (mass squash)Niko Matsakis-7/+7
2013-04-18core: io: the read_until function checks bytes not chars, so type should ↵Huon Wilson-6/+6
reflect that.
2013-04-14core: remove unnecessary unsafe blocks/functionsAlex Crichton-14/+9
2013-04-02auto merge of #5674 : steveklabnik/rust/improve_reader_util_docs, r=catamorphismbors-40/+335
I filled out better descriptions for all of the necessary functions. r?
2013-04-02Remove excess trailing whitespace.Steve Klabnik-61/+61
2013-04-02remove trailing whitespaceSteve Klabnik-17/+17
2013-04-01Typo fix. u8 -> i8Steve Klabnik-1/+1
2013-04-01Improve docs for Core::ReaderUtil.Steve Klabnik-40/+335
I filled out better descriptions for all of the neccesary functions.
2013-04-01Improve documentation for core::io.Steve Klabnik-8/+68
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-36/+36
2013-03-28Removing unused importsAlex Crichton-1/+1
2013-03-26librustc: Modify all code to use new lifetime binder syntaxPatrick Walton-2/+2
2013-03-26libcore: Change `[const T]` to `const [T]` everywherePatrick Walton-8/+10
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-5/+5
2013-03-22auto merge of #5398 : dbaupp/rust/core-readlines, r=graydonbors-6/+49
The `each_line` function in `ReaderUtil` acts very differently to equivalent functions in Python, Ruby, Clojure etc. E.g. given a file `t` with contents `trailing\nnew line\n` and `n` containing `no trailing\nnew line`: Rust: ```Rust t: ~[~"trailing", ~"new line", ~""] n: ~[~"no trailing", ~"new line"] ``` Python: ```Python >>> open('t').readlines() ['trailing\n', 'new line\n'] >>> open('n').readlines() ['no trailing\n', 'new line'] ``` Ruby: ```Ruby irb(main):001:0> File.readlines('t') => ["trailing\n", "new line\n"] irb(main):002:0> File.readlines('n') => ["no trailing\n", "new line"] ``` Clojure ```Clojure user=> (read-lines "t") ("trailing" "new line") user=> (read-lines "n") ("no trailing" "new line") ``` The extra string that rust includes at the end is inconsistent, and means that it is impossible to distinguish between the "real" empty line a file that ends `...\n\n`, and the "fake" one after the last `\n`. The code attached makes Rust's `each_line` act like Clojure (and PHP, i.e. not including the `\n`), as well as adjusting `str::lines` to fix the trailing empty line problem. Also, add a convenience `read_lines` method to read all the lines in a file into a vector.
2013-03-23libcore: handle trailing newlines more like other languages.Huon Wilson-6/+49
Specifically, `lines` and `each_line` will not emit a trailing empty string when given "...\n". Also, add `read_lines`, which just collects all of `each_line` into a vector, and `split_*_no_trailing` which will is the generalised version of `lines`.
2013-03-22core: replace uses of old deriving attribute with new oneAndrew Paseltiner-1/+1
2013-03-22auto merge of #5484 : pcwalton/rust/snapshots, r=pcwaltonbors-6/+0
2013-03-21librustc: Register new snapshotsPatrick Walton-6/+0
2013-03-21librustc: Forbid destructors from being attached to any structs that might ↵Patrick Walton-6/+8
contain non-Owned fields. r=nmatsakis
2013-03-21libcore: Remove a few possibly-cyclic imports in an effort to unbreak the ↵Patrick Walton-1/+3
tree on Linux
2013-03-20auto merge of #5456 : graydon/rust/fixups, r=pcwaltonbors-1/+5
Stage markers for stage3 and a trivial prelude fix.
2013-03-20libsyntax: Never use `::<>` in the type grammarPatrick Walton-1/+1