From 2bbeeec8cf26c1b165cdc5e6548b28bbc3c1d6a3 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 22 Jun 2024 12:26:04 -0700 Subject: be more careful about what does and doesnt need alloc --- src/display.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/display.rs') diff --git a/src/display.rs b/src/display.rs index 77f6ba9..3965bdc 100644 --- a/src/display.rs +++ b/src/display.rs @@ -10,12 +10,15 @@ use core::ops::Neg; mod display_sink; -pub use display_sink::{DisplaySink, FmtSink, InstructionTextSink}; +pub use display_sink::{DisplaySink, FmtSink}; +#[cfg(feature = "alloc")] +pub use display_sink::InstructionTextSink; /// translate a byte in range `[0, 15]` to a lowercase base-16 digit. /// /// if `c` is in range, the output is always valid as the sole byte in a utf-8 string. if `c` is out /// of range, the returned character might not be a valid single-byte utf-8 codepoint. +#[cfg(feature = "alloc")] // this function is of course not directly related to alloc, but it's only needed by impls that themselves are only present with alloc. fn u8_to_hex(c: u8) -> u8 { // this conditional branch is faster than a lookup for... most architectures (especially x86 // with cmov) -- cgit v1.1