Navigation Menu

Skip to content

Commit

Permalink
add println!() macro with out any arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
sbwtw committed Sep 29, 2016
1 parent eee2d04 commit 583c93d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libstd/macros.rs
Expand Up @@ -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)*));
}
Expand Down

0 comments on commit 583c93d

Please sign in to comment.