Skip to content

Commit 2f47e52

Browse files
committed
---
yaml --- r: 65089 b: refs/heads/master c: 9283dfe h: refs/heads/master i: 65087: 8e9ca3c v: v3
1 parent 398665c commit 2f47e52

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
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: 7396f7f004667610455557e7872330b59fafc79a
2+
refs/heads/master: 9283dfe0b4dfbad176821ed93df6d519ad58423a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libcore/io.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,13 +1571,57 @@ pub fn buffered_file_writer(path: &Path) -> Result<@Writer, ~str> {
15711571
// FIXME (#2004) it would be great if this could be a const
15721572
// FIXME (#2004) why are these different from the way stdin() is
15731573
// implemented?
1574+
1575+
1576+
/**
1577+
* Gives a `Writer` which allows you to write to the standard output.
1578+
*
1579+
* # Examples
1580+
* ~~~
1581+
* let stdout = core::io::stdout();
1582+
* stdout.write_str("hello\n");
1583+
* ~~~
1584+
*/
15741585
pub fn stdout() -> @Writer { fd_writer(libc::STDOUT_FILENO as c_int, false) }
1586+
1587+
/**
1588+
* Gives a `Writer` which allows you to write to standard error.
1589+
*
1590+
* # Examples
1591+
* ~~~
1592+
* let stderr = core::io::stderr();
1593+
* stderr.write_str("hello\n");
1594+
* ~~~
1595+
*/
15751596
pub fn stderr() -> @Writer { fd_writer(libc::STDERR_FILENO as c_int, false) }
15761597

1598+
/**
1599+
* Prints a string to standard output.
1600+
*
1601+
* This string will not have an implicit newline at the end. If you want
1602+
* an implicit newline, please see `println`.
1603+
*
1604+
* # Examples
1605+
* ~~~
1606+
* // print is imported into the prelude, and so is always available.
1607+
* print("hello");
1608+
* ~~~
1609+
*/
15771610
pub fn print(s: &str) {
15781611
stdout().write_str(s);
15791612
}
15801613

1614+
/**
1615+
* Prints a string to standard output, followed by a newline.
1616+
*
1617+
* If you do not want an implicit newline, please see `print`.
1618+
*
1619+
* # Examples
1620+
* ~~~
1621+
* // println is imported into the prelude, and so is always available.
1622+
* println("hello");
1623+
* ~~~
1624+
*/
15811625
pub fn println(s: &str) {
15821626
stdout().write_line(s);
15831627
}

0 commit comments

Comments
 (0)