Skip to content

Commit

Permalink
Writer: implement Print<&T> for integers and char
Browse files Browse the repository at this point in the history
  • Loading branch information
byeongkeunahn committed Nov 20, 2024
1 parent 99f64f0 commit 2cf0535
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions basm-std/src/platform/io/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,15 @@ macro_rules! impl_print{
self.byte_unchecked(b'\n');
}
}
impl<const N: usize> Print<&$ty> for Writer<N> {
fn print(&mut self, x: &$ty) {
self.$ty(*x);
}
fn println(&mut self, x: &$ty) {
self.$ty(*x);
self.byte_unchecked(b'\n');
}
}
)*
}
}
Expand Down

0 comments on commit 2cf0535

Please sign in to comment.