diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-07-15 11:52:11 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@commure.com> | 2018-07-19 23:18:07 -0700 |
| commit | fbce952193d38328c39262cf2fb7f7bfbe088a70 (patch) | |
| tree | d4dbd97694e5310b68149c2d653ece3664fa9edf /src/libstd | |
| parent | f53c145ef18db6543e8e5420e172e04b6054db2e (diff) | |
| download | rust-fbce952193d38328c39262cf2fb7f7bfbe088a70.tar.gz rust-fbce952193d38328c39262cf2fb7f7bfbe088a70.zip | |
review comments: modify note wording and change `println`
- Don't print the newline on its own to avoid the possibility of printing it out of order due to `stdout` locking. - Modify wording of `concat!()` with non-literals to not mislead into believing that only `&str` literals are accepted. - Add test for `concat!()` with non-literals.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/macros.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index a4a6ed73c61..7f3c8fcdd5a 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -155,14 +155,7 @@ macro_rules! print { #[stable(feature = "rust1", since = "1.0.0")] macro_rules! println { () => (print!("\n")); - ($fmt:expr) => ({ - print!($fmt); - print!("\n"); - }); - ($fmt:expr, $($arg:tt)*) => ({ - print!($fmt, $($arg)*); - print!("\n"); - }); + ($($arg:tt)*) => (print!("{}\n", format_args!($($arg)*))); } /// Macro for printing to the standard error. |
