Skip to content

Commit 3cabe74

Browse files
committed
Add a print and println to std::io
1 parent 5950ae3 commit 3cabe74

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/io.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ fn buffered_file_buf_writer(path: str) -> buf_writer {
384384
fn stdout() -> writer { ret new_writer(fd_buf_writer(1, option::none)); }
385385
fn stderr() -> writer { ret new_writer(fd_buf_writer(2, option::none)); }
386386

387+
fn print(s: str) { stdout().write_str(s); }
388+
fn println(s: str) { stdout().write_str(s + "\n"); }
389+
387390
type str_writer =
388391
obj {
389392
fn get_writer() -> writer;

0 commit comments

Comments
 (0)