From 59f167042adc748ed156bdd05bc0ecc64524501d Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 31 Mar 2019 04:09:06 -0700 Subject: fix sign display bug --- src/display.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/display.rs b/src/display.rs index 7dcdfb5..5ba9cd1 100644 --- a/src/display.rs +++ b/src/display.rs @@ -78,7 +78,7 @@ pub fn signed_i8_hex(imm: i8) -> String { } else { (false, imm) }; - format!("{}{:#x}", sign, imm) + format!("{}{:#x}", if sign { "-" } else { "" } , imm) } pub fn signed_i16_hex(imm: i16) -> String { @@ -89,7 +89,7 @@ pub fn signed_i16_hex(imm: i16) -> String { } else { (false, imm) }; - format!("{}{:#x}", sign, imm) + format!("{}{:#x}", if sign { "-" } else { "" } , imm) } pub fn signed_i32_hex(imm: i32) -> String { @@ -100,7 +100,7 @@ pub fn signed_i32_hex(imm: i32) -> String { } else { (false, imm) }; - format!("{}{:#x}", sign, imm) + format!("{}{:#x}", if sign { "-" } else { "" } , imm) } pub fn signed_i64_hex(imm: i64) -> String { @@ -111,5 +111,5 @@ pub fn signed_i64_hex(imm: i64) -> String { } else { (false, imm) }; - format!("{}{:#x}", sign, imm) + format!("{}{:#x}", if sign { "-" } else { "" } , imm) } -- cgit v1.1