about summary refs log tree commit diff
path: root/src/libstd/fmt
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-09-12 19:36:58 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-09-15 01:09:00 -0700
commitcfe3db810b7991ef1144afaed4156ddc2586efef (patch)
tree070edc52983621820a65909f2b091d8bc152f43b /src/libstd/fmt
parent36872e4180331e4a7f00329abe7972488ce216cf (diff)
downloadrust-cfe3db810b7991ef1144afaed4156ddc2586efef.tar.gz
rust-cfe3db810b7991ef1144afaed4156ddc2586efef.zip
Reduce the amount of complexity in format!
This renames the syntax-extension file to format from ifmt, and it also reduces
the amount of complexity inside by defining all other macros in terms of
format_args!
Diffstat (limited to 'src/libstd/fmt')
-rw-r--r--src/libstd/fmt/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs
index c7ab508ea6e..61024ee834b 100644
--- a/src/libstd/fmt/mod.rs
+++ b/src/libstd/fmt/mod.rs
@@ -452,6 +452,13 @@ pub fn write(output: &mut io::Writer, args: &Arguments) {
     unsafe { write_unsafe(output, args.fmt, args.args) }
 }
 
+/// The `writeln` function takes the same arguments as `write`, except that it
+/// will also write a newline (`\n`) character at the end of the format string.
+pub fn writeln(output: &mut io::Writer, args: &Arguments) {
+    unsafe { write_unsafe(output, args.fmt, args.args) }
+    output.write(['\n' as u8]);
+}
+
 /// The `write_unsafe` function takes an output stream, a precompiled format
 /// string, and a list of arguments. The arguments will be formatted according
 /// to the specified format string into the output stream provided.