Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9ff0750

Browse files
Merge pull request #353 from async-rs/fix-printing
fix print macros
2 parents 6eb3ea2 + 4d34a15 commit 9ff0750

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/macros.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ macro_rules! print {
8686
#[macro_export]
8787
macro_rules! println {
8888
() => ($crate::print!("\n"));
89-
($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*)))
89+
($($arg:tt)*) => (async {
90+
$crate::io::_print(format_args!($($arg)*)).await;
91+
$crate::io::_print(format_args!("\n")).await;
92+
})
9093
}
9194

9295
/// Prints to the standard error.
@@ -158,6 +161,7 @@ macro_rules! eprintln {
158161
($($arg:tt)*) => (
159162
async {
160163
$crate::io::_eprint(format_args!($($arg)*)).await;
164+
$crate::io::_eprint(format_args!("\n")).await;
161165
}
162166
);
163167
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /