From 514586f65bf493b5b48aaf7208f9b381b9293eb7 Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 18 Jun 2024 17:09:26 -0700 Subject: write_fixed_size really should always be inlined... --- src/long_mode/display.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/long_mode') diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index 6d3be36..99d4f91 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -371,6 +371,7 @@ pub enum TokenType { } pub trait DisplaySink: fmt::Write { + #[inline(always)] fn write_fixed_size(&mut self, s: &str) -> Result<(), core::fmt::Error> { self.write_str(s) } @@ -493,6 +494,7 @@ impl fmt::Write for BigEnoughString { // TODO: delete this whole thing? maybe? impl DisplaySink for alloc::string::String { + #[inline(always)] fn write_fixed_size(&mut self, s: &str) -> Result<(), core::fmt::Error> { self.reserve(s.len()); let buf = unsafe { self.as_mut_vec() }; @@ -787,6 +789,7 @@ impl DisplaySink for alloc::string::String { } impl DisplaySink for BigEnoughString { + #[inline(always)] fn write_fixed_size(&mut self, s: &str) -> Result<(), core::fmt::Error> { let buf = unsafe { self.content.as_mut_vec() }; let new_bytes = s.as_bytes(); -- cgit v1.1