Skip to content

Commit

Permalink
Merge pull request #353 from async-rs/fix-printing
Browse files Browse the repository at this point in the history
fix print macros
  • Loading branch information
yoshuawuyts authored Oct 16, 2019
2 parents 6eb3ea2 + 4d34a15 commit 9ff0750
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ macro_rules! print {
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));
($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*)))
($($arg:tt)*) => (async {
$crate::io::_print(format_args!($($arg)*)).await;
$crate::io::_print(format_args!("\n")).await;
})
}

/// Prints to the standard error.
Expand Down Expand Up @@ -158,6 +161,7 @@ macro_rules! eprintln {
($($arg:tt)*) => (
async {
$crate::io::_eprint(format_args!($($arg)*)).await;
$crate::io::_eprint(format_args!("\n")).await;
}
);
}

0 comments on commit 9ff0750

Please sign in to comment.