Skip to content

Commit 8cdb533

Browse files
committed
---
yaml --- r: 65080 b: refs/heads/master c: a389d86 h: refs/heads/master v: v3
1 parent af0e085 commit 8cdb533

File tree

2 files changed

+11
-43
lines changed

2 files changed

+11
-43
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e0b1bdca5b56a104d8c221cb3bbb7eb16b5fcec4
2+
refs/heads/master: a389d86fa46d4a01b7839560a8851d84b7b2153d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libcore/io.rs

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,16 @@ pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
10101010
// top-level functions that take a reader, or a set of default methods on
10111011
// reader (which can then be called reader)
10121012

1013+
/**
1014+
* Gives a `Reader` that allows you to read values from standard input.
1015+
*
1016+
* # Examples
1017+
* ~~~
1018+
* let stdin = core::io::stdin();
1019+
* let line = stdin.read_line();
1020+
* core::io::print(line);
1021+
* ~~~
1022+
*/
10131023
pub fn stdin() -> @Reader {
10141024
unsafe {
10151025
@rustrt::rust_get_stdin() as @Reader
@@ -1561,55 +1571,13 @@ pub fn buffered_file_writer(path: &Path) -> Result<@Writer, ~str> {
15611571
// FIXME (#2004) it would be great if this could be a const
15621572
// FIXME (#2004) why are these different from the way stdin() is
15631573
// implemented?
1564-
1565-
1566-
/**
1567-
* Gives a `Writer` which allows you to write to the standard output.
1568-
*
1569-
* # Examples
1570-
* ~~~
1571-
* let stdout = core::io::stdout();
1572-
* stdout.write_str("hello\n");
1573-
* ~~~
1574-
*/
15751574
pub fn stdout() -> @Writer { fd_writer(libc::STDOUT_FILENO as c_int, false) }
1576-
1577-
/**
1578-
* Gives a `Writer` which allows you to write to standard error.
1579-
*
1580-
* # Examples
1581-
* ~~~
1582-
* let stderr = core::io::stderr();
1583-
* stderr.write_str("hello\n");
1584-
* ~~~
1585-
*/
15861575
pub fn stderr() -> @Writer { fd_writer(libc::STDERR_FILENO as c_int, false) }
15871576
1588-
/**
1589-
* Prints a string to standard output.
1590-
*
1591-
* This string will not have an implicit newline at the end. If you want
1592-
* an implicit newline, please see `println`.
1593-
*
1594-
* # Examples
1595-
* ~~~
1596-
* core::io::print("hello");
1597-
* ~~~
1598-
*/
15991577
pub fn print(s: &str) {
16001578
stdout().write_str(s);
16011579
}
16021580
1603-
/**
1604-
* Prints a string to standard output, followed by a newline.
1605-
*
1606-
* If you do not want an implicit newline, please see `print`.
1607-
*
1608-
* # Examples
1609-
* ~~~
1610-
* core::io::println("hello");
1611-
* ~~~
1612-
*/
16131581
pub fn println(s: &str) {
16141582
stdout().write_line(s);
16151583
}

0 commit comments

Comments
 (0)