From cfe3db810b7991ef1144afaed4156ddc2586efef Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 12 Sep 2013 19:36:58 -0700 Subject: 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! --- src/libstd/fmt/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstd') 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. -- cgit 1.4.1-3-g733a5