From aa79e826869a7fed8df6b4f7e7a7503565659f89 Mon Sep 17 00:00:00 2001 From: iximeow Date: Wed, 29 May 2019 00:07:31 -0700 Subject: fix some warnings and rdtsc/swapgs decode errors --- src/display.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/display.rs') diff --git a/src/display.rs b/src/display.rs index 76db507..dfddeca 100644 --- a/src/display.rs +++ b/src/display.rs @@ -1,13 +1,9 @@ extern crate yaxpeax_arch; extern crate termion; -use termion::color; - use std::fmt; -use std::hint::unreachable_unchecked; - -use yaxpeax_arch::{Arch, Colorize, ColorSettings, Decodable, LengthedInstruction, ShowContextual, YaxColors}; +use yaxpeax_arch::{Colorize, ColorSettings, ShowContextual, YaxColors}; use yaxpeax_arch::display::*; use ::{RegSpec, RegisterBank, Opcode, Operand, Instruction, Segment}; @@ -545,7 +541,7 @@ impl Colorize for Instruction { } impl ShowContextual], T> for Instruction { - fn contextualize(&self, colors: Option<&ColorSettings>, address: u64, context: Option<&[Option]>, out: &mut T) -> std::fmt::Result { + fn contextualize(&self, colors: Option<&ColorSettings>, _address: u64, context: Option<&[Option]>, out: &mut T) -> std::fmt::Result { if self.prefixes.lock { write!(out, "lock ")?; } @@ -561,7 +557,7 @@ impl ShowContextual], T> for Instructi ref x @ _ => { write!(out, " ")?; if let Some(prefix) = self.segment_override_for_op(0) { - write!(out, "{}:", prefix); + write!(out, "{}:", prefix)?; } x.colorize(colors, out)?; } @@ -580,14 +576,14 @@ impl ShowContextual], T> for Instructi x @ &Operand::Register(_) => { write!(out, ", ")?; if let Some(prefix) = self.segment_override_for_op(1) { - write!(out, "{}:", prefix); + write!(out, "{}:", prefix)?; } x.colorize(colors, out) } x @ _ => { write!(out, ", byte ")?; if let Some(prefix) = self.segment_override_for_op(1) { - write!(out, "{}:", prefix); + write!(out, "{}:", prefix)?; } x.colorize(colors, out) } @@ -606,14 +602,14 @@ impl ShowContextual], T> for Instructi x @ &Operand::Register(_) => { write!(out, ", ")?; if let Some(prefix) = self.segment_override_for_op(1) { - write!(out, "{}:", prefix); + write!(out, "{}:", prefix)?; } x.colorize(colors, out) } x @ _ => { write!(out, ", word ")?; if let Some(prefix) = self.segment_override_for_op(1) { - write!(out, "{}:", prefix); + write!(out, "{}:", prefix)?; } x.colorize(colors, out) } @@ -632,7 +628,7 @@ impl ShowContextual], T> for Instructi x @ _ => { write!(out, ", ")?; if let Some(prefix) = self.segment_override_for_op(1) { - write!(out, "{}:", prefix); + write!(out, "{}:", prefix)?; } x.colorize(colors, out) } -- cgit v1.1