Skip to content

Commit 6acf6b2

Browse files
committed
---
yaml --- r: 73247 b: refs/heads/dist-snap c: 5877727 h: refs/heads/master i: 73245: fbd3dfe 73243: 658d337 73239: f15bccc 73231: 8e14e82 73215: 9e7beb4 v: v3
1 parent 3cfe9fc commit 6acf6b2

File tree

2 files changed

+45
-11
lines changed

2 files changed

+45
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: ebdb0dee272829f2410edd51acdb12f20721ce42
10+
refs/heads/dist-snap: 58777272857526eb301bfedd909e6826e5edf716
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/io.rs

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,16 +1010,6 @@ 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-
*/
10231013
pub fn stdin() -> @Reader {
10241014
unsafe {
10251015
@rustrt::rust_get_stdin() as @Reader
@@ -1571,13 +1561,57 @@ pub fn buffered_file_writer(path: &Path) -> Result<@Writer, ~str> {
15711561
// FIXME (#2004) it would be great if this could be a const
15721562
// FIXME (#2004) why are these different from the way stdin() is
15731563
// 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+
*/
15741575
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+
*/
15751586
pub fn stderr() -> @Writer { fd_writer(libc::STDERR_FILENO as c_int, false) }
15761587

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+
* // print is imported into the prelude, and so is always available.
1597+
* print("hello");
1598+
* ~~~
1599+
*/
15771600
pub fn print(s: &str) {
15781601
stdout().write_str(s);
15791602
}
15801603

1604+
/**
1605+
* Prints a string to standard output, followed by a newline.
1606+
*
1607+
* If you do not want an implicit newline, please see `print`.
1608+
*
1609+
* # Examples
1610+
* ~~~
1611+
* // println is imported into the prelude, and so is always available.
1612+
* println("hello");
1613+
* ~~~
1614+
*/
15811615
pub fn println(s: &str) {
15821616
stdout().write_line(s);
15831617
}

0 commit comments

Comments
 (0)