Auto merge of #36825 - sbwtw:master, r=alexcrichton
add println!() macro with out any arguments lets add println!() to write "\n". like java https://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html#println()
This commit is contained in:
@@ -112,12 +112,14 @@ macro_rules! print {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// println!();
|
||||
/// println!("hello there!");
|
||||
/// println!("format {} arguments", "some");
|
||||
/// ```
|
||||
#[macro_export]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
macro_rules! println {
|
||||
() => (print!("\n"));
|
||||
($fmt:expr) => (print!(concat!($fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user