diff --git a/src/instruction.rs b/src/instruction.rs index 0214fa5..076e042 100644 --- a/src/instruction.rs +++ b/src/instruction.rs @@ -1165,7 +1165,7 @@ impl From for InstrRegisterPair { } impl TryFrom for RegisterPair { - type Error = String; // FIXME: Proper error type goes here. + type Error = &'static str; // FIXME: Proper error type goes here. fn try_from(pair: InstrRegisterPair) -> Result { match pair { @@ -1176,10 +1176,10 @@ impl TryFrom for RegisterPair { InstrRegisterPair::SP => Ok(Self::SP), InstrRegisterPair::PC => Ok(Self::PC), InstrRegisterPair::IncrementHL => { - Err("Can not convert InstrRegisterPair::IncrementHL to RegisterPair".to_string()) + Err("Can not convert InstrRegisterPair::IncrementHL to RegisterPair") } InstrRegisterPair::DecrementHL => { - Err("Can not convert InstrRegisterPair::DecrementHL to RegisterPair".to_string()) + Err("Can not convert InstrRegisterPair::DecrementHL to RegisterPair") } } } @@ -1199,7 +1199,7 @@ enum InstrRegister { } impl TryFrom for InstrRegister { - type Error = String; // FIXME: Proper error type goes here + type Error = &'static str; // FIXME: Proper error type goes here fn try_from(register: Register) -> Result { match register { @@ -1210,7 +1210,7 @@ impl TryFrom for InstrRegister { Register::E => Ok(Self::E), Register::H => Ok(Self::H), Register::L => Ok(Self::L), - Register::Flag => Err("Can not convert Register::Flag to InstrRegister".to_string()), + Register::Flag => Err("Can not convert Register::Flag to InstrRegister"), } } }