diff options
author | iximeow <me@iximeow.net> | 2024-06-22 12:26:04 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2024-06-22 12:26:04 -0700 |
commit | 2bbeeec8cf26c1b165cdc5e6548b28bbc3c1d6a3 (patch) | |
tree | e96d808768bf10f6a5c9f7358ff7e8fa8dca8809 /src/display.rs | |
parent | 0c69ee37f98ce616df5237cbe74952c2a28cc5cb (diff) |
be more careful about what does and doesnt need alloc
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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) |