|
4 | 4 | //! throughout this crate to avoid depending on the `arbitrary` crate |
5 | 5 | //! unconditionally (use the `fuzz` feature instead). |
6 | 6 |
|
| 7 | +use std::string::{String, ToString}; |
| 8 | +use std::vec::Vec; |
| 9 | +use std::{format, println}; |
| 10 | + |
7 | 11 | use crate::{ |
8 | 12 | AmodeOffset, AmodeOffsetPlusKnownOffset, AsReg, CodeSink, DeferredTarget, Fixed, Gpr, Inst, |
9 | 13 | KnownOffset, NonRspGpr, Registers, TrapCode, Xmm, |
@@ -146,7 +150,7 @@ fn disassemble(assembled: &[u8], original: &Inst<FuzzRegs>) -> String { |
146 | 150 | } |
147 | 151 |
|
148 | 152 | fn pretty_print_hexadecimal(hex: &[u8]) -> String { |
149 | | - use std::fmt::Write; |
| 153 | + use core::fmt::Write; |
150 | 154 | let mut s = String::with_capacity(hex.len() * 2); |
151 | 155 | for b in hex { |
152 | 156 | write!(&mut s, "{b:02X}").unwrap(); |
@@ -183,7 +187,7 @@ macro_rules! hex_print_signed_imm { |
183 | 187 | /// - print negative values as `-0x...` (signed hex) instead of `0xff...` |
184 | 188 | /// (normal hex) |
185 | 189 | /// - print `mov` immediates as base-10 instead of base-16 (?!). |
186 | | -fn replace_signed_immediates(dis: &str) -> std::borrow::Cow<'_, str> { |
| 190 | +fn replace_signed_immediates(dis: &str) -> alloc::borrow::Cow<'_, str> { |
187 | 191 | match dis.find('$') { |
188 | 192 | None => dis.into(), |
189 | 193 | Some(idx) => { |
@@ -259,7 +263,7 @@ fn remove_after_parenthesis_test() { |
259 | 263 | } |
260 | 264 |
|
261 | 265 | /// Run some post-processing on the disassembly to make it match Capstone. |
262 | | -fn fix_up(dis: &str) -> std::borrow::Cow<'_, str> { |
| 266 | +fn fix_up(dis: &str) -> alloc::borrow::Cow<'_, str> { |
263 | 267 | let dis = remove_after_semicolon(dis); |
264 | 268 | replace_signed_immediates(&dis) |
265 | 269 | } |
|
0 commit comments