diff --git a/crates/gpui/src/keymap.rs b/crates/gpui/src/keymap.rs index 5d000081cffdac7b1061e5abc9d7e30889a5dd48..be846bbfa1c696a8c43b11565dbbdd89d66f6bf4 100644 --- a/crates/gpui/src/keymap.rs +++ b/crates/gpui/src/keymap.rs @@ -301,9 +301,7 @@ impl Keystroke { } } - if key.is_none() { - return Err(anyhow!("Invalid keystroke `{}`", source)); - } + let key = key.ok_or_else(|| anyhow!("Invalid keystroke `{}`", source))?; Ok(Keystroke { ctrl, @@ -311,7 +309,7 @@ impl Keystroke { shift, cmd, function, - key: key.unwrap(), + key, }) }