pub fn into_hotkey(self) -> Result<Option<KeyCode>> {
        match self {
            Value::Hotkey(v) => Ok(v),
            Value::String(v) | Value::OptionalString(Some(v)) => {
                v.parse().map_err(|_| Error::WrongType).map(Some)
            }
            Value::OptionalString(None) => Ok(None),
            _ => Err(Error::WrongType),
        }
    }
/// Tries to convert the value into a hotkey.
Tries to convert the value into a hotkey.
Tries to convert the value into a hotkey .
pub fn into_hotkey(self) -> Result<Option<KeyCode>> {
        match self {
            Value::Hotkey(v) => Ok(v),
            Value::String(v) | Value::OptionalString(Some(v)) => {
                v.parse().map_err(|_| Error::WrongType).map(Some)
            }
            Value::OptionalString(None) => Ok(None),
            _ => Err(Error::WrongType),
        }
    }
pub fn into_hotkey ( self ) -> Result < Option < KeyCode > > { match self { Value :: Hotkey ( v ) => Ok ( v ) , Value :: String ( v ) | Value :: OptionalString ( Some ( v ) ) => { v . parse ( ) . map_err ( | _ | Error :: WrongType ) . map ( Some ) } Value :: OptionalString ( None ) => Ok ( None ) , _ => Err ( Error :: WrongType ) , } }
Tries to convert the value into a hotkey.
Tries to convert the value into a hotkey .
self
self