From fa1797b21c93c85b453fb90b0060a2cdf6137cb9 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 6 Sep 2018 20:44:33 +0200 Subject: make `iprintln!` not depend on `iprint!` the preferred way to import macros in Rust 2018 is via `use`. If you import `iprintln` and try to use you'll get an error if the `iprint` macro has not been imported as well. This commit makes `iprintln` work w/o having to import `iprint` as well. --- src/macros.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/macros.rs b/src/macros.rs index e41cdc5..813552f 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -13,13 +13,13 @@ macro_rules! iprint { #[macro_export] macro_rules! iprintln { ($channel:expr) => { - iprint!($channel, "\n"); + $crate::itm::write_str($channel, "\n"); }; ($channel:expr, $fmt:expr) => { - iprint!($channel, concat!($fmt, "\n")); + $crate::itm::write_str($channel, concat!($fmt, "\n")); }; ($channel:expr, $fmt:expr, $($arg:tt)*) => { - iprint!($channel, concat!($fmt, "\n"), $($arg)*); + $crate::itm::write_fmt($channel, format_args!(concat!($fmt, "\n"), $($arg)*)); }; } -- cgit v1.2.3