From 2cf05357c39f59a2115b5c8a125748ab2beb380b Mon Sep 17 00:00:00 2001 From: Byeongkeun Ahn <7p54ks3@naver.com> Date: Wed, 20 Nov 2024 23:16:25 +0900 Subject: [PATCH] Writer: implement Print<&T> for integers and char --- basm-std/src/platform/io/writer.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/basm-std/src/platform/io/writer.rs b/basm-std/src/platform/io/writer.rs index 8e3824ac..b967c892 100644 --- a/basm-std/src/platform/io/writer.rs +++ b/basm-std/src/platform/io/writer.rs @@ -543,6 +543,15 @@ macro_rules! impl_print{ self.byte_unchecked(b'\n'); } } + impl Print<&$ty> for Writer { + fn print(&mut self, x: &$ty) { + self.$ty(*x); + } + fn println(&mut self, x: &$ty) { + self.$ty(*x); + self.byte_unchecked(b'\n'); + } + } )* } }