Removed the Opcode::NotAnOpcode variant, replaced its uses with Option<Opcode>, and used the NonZero optimization to maintain the small 1-byte size of an optional Opcode.

This commit is contained in:
Angus Holder
2017-02-22 16:13:48 +00:00
committed by Jakob Stoklund Olesen
parent 3d0240d244
commit a4e4776087
6 changed files with 30 additions and 32 deletions

View File

@@ -1088,7 +1088,7 @@ impl<'a> Parser<'a> {
// Parse the operands following the instruction opcode.
// This depends on the format of the opcode.
fn parse_inst_operands(&mut self, ctx: &Context, opcode: Opcode) -> Result<InstructionData> {
Ok(match opcode.format().unwrap() {
Ok(match opcode.format() {
InstructionFormat::Nullary => {
InstructionData::Nullary {
opcode: opcode,