From 4fb654284c9dcd2409300b58b11f3a6906d7e4f8 Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 18 Jun 2024 15:25:28 -0700 Subject: actually use small-string specializations when available --- src/long_mode/display.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index 575765c..cf2edae 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -5646,17 +5646,12 @@ impl Instruction { } pub fn write_to(&self, out: &mut T) -> fmt::Result { - self.display_with(DisplayStyle::Intel).contextualize(&NoColors, 0, Some(&NoContext), out) + contextualize_intel(self, &NoColors, 0, Some(&NoContext), out) +// self.display_with(DisplayStyle::Intel).contextualize(&NoColors, 0, Some(&NoContext), out) } } -fn contextualize_intel(instr: &Instruction, colors: &Y, _address: u64, _context: Option<&NoContext>, out: &mut T) -> fmt::Result { - let mut out = NoColorsSink { - out, - }; - let mut out = &mut out; - use core::fmt::Write; - +fn contextualize_intel(instr: &Instruction, colors: &Y, _address: u64, _context: Option<&NoContext>, out: &mut T) -> fmt::Result { if instr.xacquire() { out.write_fixed_size("xacquire ")?; } @@ -6107,6 +6102,11 @@ impl <'instr, T: fmt::Write, Y: YaxColors> ShowContextual match style { DisplayStyle::Intel => { + let mut out = NoColorsSink { + out, + }; + let mut out = &mut out; + contextualize_intel(instr, colors, address, context, out) } DisplayStyle::C => { -- cgit v1.1