From 753955dbb4e6c77b9c56c659fe766a867c575023 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Thu, 1 Feb 2024 15:08:30 +0100 Subject: pub(crate) use for println macros The println! and print! macros are defined in submodule "io", I have to add this trick to make it work across the crate. Maybe there is a better way... --- src/io.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/io.rs b/src/io.rs index 988db09..417fc1d 100644 --- a/src/io.rs +++ b/src/io.rs @@ -2,7 +2,6 @@ use crate::machine::cgascr::CGAScreen; use core::fmt; use lazy_static::lazy_static; use spin::Mutex; - // TODO I want my own locking primitive for practice, instead of stock spin lock lazy_static! { // TODO perhaps remove the 'a lifetime from the struc defs @@ -13,12 +12,14 @@ lazy_static! { macro_rules! print { ($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*))); } +pub(crate) use print; #[macro_export] macro_rules! println { () => ($crate::print!("\n")); ($($arg:tt)*) => (print!("{}\n", format_args!($($arg)*))); } +pub(crate) use println; pub fn _print(args: fmt::Arguments) { use core::fmt::Write; -- cgit v1.2.3-70-g09d2