fix parse-bytecode command: better table formatting and doesn't omit last data entry
@@ -20,14 +20,14 @@ pub(crate) fn exec(command: Command) -> Result<(), String> {
f.read(&mut buffer).expect("buffer overflow");
let mut instructions = vec![];
- for i in (0..buffer.len() - 4).step_by(4) {
+ for i in (0..buffer.len()).step_by(4) {
let i = i as usize;
let raw = &buffer[i..i + 4];
let op = fuel_asm::Opcode::from_bytes_unchecked(raw.try_into().unwrap());
instructions.push((raw, op));
}
- // println!("word\tbyte\top\t\traw\tnotes");
let mut table = term_table::Table::new();
+ table.separate_rows = false;
table.add_row(Row::new(vec![
TableCell::new("half-word"),
TableCell::new("byte"),
